Denormalise
3rd normal form
Master
Slave
Consistency
Sharding
Consistency/
Availability
./bin/cassandra
./bin/cqlsh
CREATE KEYSPACE confoo WITH replication = {
'class': 'SimpleStrategy',
'replication_factor': '3'
};
USE confoo;
CREATE TABLE users (
firstname text,
lastname text,
age int,
email text,
city text,
PRIMARY KEY (lastname));
CQL - Very similar to SQL
Facebook - Open sourced in 2008
Written mostly in Java
Lots of libs
Potential contributors
Compiled
Performance
JMX for monitoring
Tools for profiling
JVM Tuning + Performance
Convenient to manipulate data structures
Nodes (machines)
Node (machine)
JVM with Cassandra
nodetool => information about each node
Nodes interact
with each other
Hello!
Hi!
Hey
Yo!
I handle 0-24!
I handle 25-49!
I handle 50-74!
I handle 75-99!
Hash ring
DATA
Coordinator
DATA
CREATE TABLE users (
firstname text,
lastname text,
age int,
email text,
city text,
PRIMARY KEY (lastname));
Part of Partition Key
Runs into a hash function and we get the range
"Tavante"
11
Replication Factor (RF)
CREATE KEYSPACE confoo WITH replication = {
'class': 'SimpleStrategy',
'replication_factor': '3'
};
USE confoo;
RF=3
confoo
RF=3
confoo
confoo
confoo
confoo
DATA
CL=ALL
Read query
RF = 3
CL=ALL
Read query
Read query
Read query
Read query
CL=ALL
Read query
Read query
Read query
Read query
Data
RAM
Disk
Commit
Log
Memtable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
SSTable
Data to read
RAM
Disk
SSTable
User
Post
Post
Post
Like
Comment
Comment
Comment
Like
Like
Music app
Playlist
Post
Post
Track
Artist
Comment
Comment
Like
Like
Artist
Track
Artist
Playlist
Track
Artist
Artist
Track
Artist
Playlist
Track
Artist
Artist
Track
Artist
PRIMARY KEY
((k_part_one, k_part_two),
k_clust_one,
k_clust_two,
k_clust_three)
Clustering Columns - define data order
Event tracking
Event tracking / Realtime streaming
A good tool to simulate a cluster in your local machine
Questions?
hannelita@gmail.com
@hannelita