#OSB2015 - video
Related motivation
Denormalise
3rd normal form
Master
Slave
Consistency
Sharding
Consistency/
Availability
./bin/cassandra
./bin/cqlsh
CREATE KEYSPACE osbridge WITH replication = {
'class': 'SimpleStrategy',
'replication_factor': '3'
};
USE osbridge;
CREATE TABLE users (
firstname text,
lastname text,
age int,
email text,
city text,
PRIMARY KEY (lastname));
CQL - Very similar to SQL
Nodes (machines)
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
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 osbridge WITH replication = {
'class': 'SimpleStrategy',
'replication_factor': '3'
};
USE osbridge;
RF=3
OSBridge
RF=3
OSBridge
OSBridge
OSBridge
CL=ALL
Read query
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
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