13. Control
Cluster
Metadata
State
Three datacenters
High RF
Wide rows
Easy dump & load
https://github.com/racker/cassandra-syncer
14. Data Model
Rich but simple
Objects used together stored together
Simple parent-child relations
One row per customer (tenant)
Composite column names
15. Data Model
Good: Bad:
Single Parent/Child Complex
Acyclic Multiple Parent/Child
22. Data Model
New Bar attached to fo123.
ID is “fo123:ba003”
23. Data Model
Baz attached to ba003
ID is “fo123:ba001:bz001”
24. Data Model
Select Foo children for 123:
select „fo123‟..‟fo123:x7f‟;
Select single Bar object attached to fo123:
select „fo123:ba001‟..‟fo123:ba001:x7f‟;
Object hierarchy reduced to a single slice.
Parent keys available from context (no extra
reads or indexes)
25. Control Cluster
API server is Node.js
Javascript ORM library
• Define object model in JS
• Read/write entire objects
• Never think about CQL
node-cassandra-client
https://github.com/racker/node-cassandra-client
31. Rollup Concepts
Slot
Pegged at 4096 slots
Circular buffer of metrics names that
have come into the system
Key is granularity + slot
Columns index keys in rollup table
33. Arrival
Full Resolution!
time, name, several metrics
metric = name, type, value
Create a locator assigned to slot
Insert metrics
Single Cassandra APPLY BATCH;
34. Process: Rolling up
• rollup(src_gran, from, to);
• from, to determine slots
• For each slot, get locator row slice
– Cols tell us which metrics are active (need roll up)
– For each column in locator row slice, slice in data
row to get metrics
• For each column (metric) in slice, add to calculations
• Store rolled up calculation in dst_gran CF
• Store locator column for slot, dst_gran
• Also rollup(metric, src_gran, from, to);
35. Rollup operations are idempotent*
Simplifies availability
Rollups are easily parallelized
Partition the locator space
36. But…
What if data arrives after rollup is
performed?
More than 24hrs late: don‟t care,
forget it
Figure out which slot the data
belongs it, flag for each
granularity in a meta row
Recalculate rollups