You are on page 1of 20

Just the animations – in PPT form – so students can re-watch them “at home”.

Apache Cassandra™ (cont.)


NOTES:
1. Many thanks to DataStax for providing this material
and granting us permission to use it!
2. These slides have been lightly modified for CS122D use.
Fun: Partitioning Animation
Tables

© Copyright 2019. Use only with permission.


Tables

© Copyright 2019. Use only with permission.


Partitions

© Copyright 2019. Use only with permission.


Partitions

© Copyright 2019. Use only with permission.


Partitions

PRIMARY KEY(state)
PRIMARY KEY((state), id)

© Copyright 2019. Use only with permission.


Partitions

Co-location
awareness!

© Copyright 2019. Use only with permission.


Fun: Ring Animation
Pressures of Scale

Peer-to-peer
(P2P)
architecture Node

© Copyright 2019. Use only with permission.


The Ring

59 (data)
Partition key  token

?
Token  node

(based on token ranges)

Showing 100
token values
(and 8 nodes)
for illustration

© Copyright 2019. Use only with permission.


The Actual Range

© Copyright 2019. Use only with permission.


Token Value Distribution

Ex:
Uneven data
distribution

Partitioner

© Copyright 2019. Use only with permission.


Token Value Distribution

Fix:
Murmur3-based
partitioner

Partitioner

© Copyright 2019. Use only with permission.


Fun: Clustering Animation
PRIMARY KEY((state), city)
act ually a
his
Q: Is t mary key?
ri
1 IgotUr
4 Dev Awesome
Data TX Houston
Austin valid p why not?)
or
7
2 Data Rowman
ComeTo Learnin’ TX Austin
Dallas (Why
2
3 ComeTo Learnin’
Lone Node TX Dallas
Snyder
5
4 Always Onomnom
IgotUr Data TX Dallas
Austin
TX (83) 6
5 Lone Star
Always Onomnom TX El Paso
Dallas
1
6 Dev
LoneAwesome
Star TX Houston
El Paso
9
7 Compact One
Data Rowman TX Houston
Austin
8 Lovin’ Ur Bytes TX Santa Fe
3
9 Lone Node
Compact One TX Snyder
Houston

© Copyright 2019. Use only with permission.


PRIMARY KEY((state), name)
city)

4
5 IgotUr
AlwaysData
Onomnom TX Austin
Dallas
7
2 Data Rowman
ComeTo Learnin’ TX Austin
Dallas
2
9 ComeTo
CompactLearnin’
One TX Dallas
Houston
7
5 Data Rowman
Always Onomnom TX Austin
Dallas

TX (83) 1
6 Dev
LoneAwesome
Star TX Houston
El Paso
4
1 IgotUr Data
Dev Awesome TX Austin
Houston
3 Compact
9 Lone Node
One TX Snyder
Houston
6
8 Lone
Lovin’Star
Ur Bytes TX
TX El Paso
Santa Fe
8
3 Lovin’ Ur Bytes
Lone Node TX Santa
SnyderFe

© Copyright 2019. Use only with permission.


PRIMARYKEY((state),
PRIMARY KEY((state),
city,name)
name)

4
5 IgotUr
AlwaysData
Onomnom TX Austin
Dallas
7
2 Data Rowman
ComeTo Learnin’ TX Austin
Dallas
2
9 ComeTo
CompactLearnin’
One TX Dallas
Houston
7 Always
5 Data Rowman
Onomnom TX Austin
Dallas

TX (83) 1 Lone
6 Dev Awesome
Star TX Houston
El Paso
4
1 IgotUr Data
Dev Awesome TX Austin
Houston
3 Compact
9 Lone Node
One TX Snyder
Houston
6
8 Lone
Lovin’Star
Ur Bytes TX
TX El Paso
Santa Fe
8
3 Lovin’ Ur Bytes
Lone Node TX Santa
SnyderFe

© Copyright 2019. Use only with permission.


PRIMARY KEY((state), city, name)

7
4 Data
IgotUrRowman
Data TX Austin
7 IgotUr
4 Data Rowman
Data TX Austin
2 Always
5 ComeToOnomnom
Learnin’ TX Dallas
2
5 ComeTo Learnin’
Always Onomnom TX Dallas

TX (83) 6 Lone Star TX El Paso


1 Dev Awesome
Compact One TX Houston
9 Compact One
Dev Awesome TX Houston
8 Lovin’ Ur Bytes TX Santa Fe
3 Lone Node TX Snyder

© Copyright 2019. Use only with permission.


PRIMARY
PRIMARY
KEY((state),
KEY((state),
city,
city,
name,
name)
id)

7 Data Rowman TX Austin


4 IgotUr Data TX Austin
5 Always Onomnom TX Dallas
2 ComeTo Learnin’ TX Dallas

TX (83) 6 Lone Star TX El Paso


1 Compact One TX Houston
9 Dev Awesome TX Houston
8 Lovin’ Ur Bytes TX Santa Fe
3 Lone Node TX Snyder

© Copyright 2019. Use only with permission.

You might also like