Why this matters
- VaultCommerce ingests millions of clickstream and order-status events per day; writing every event to Postgres would saturate the primary.
- Cassandra's tunable consistency and append-friendly storage fit time-series and audit logs.
- Interviews test whether you can explain partition keys, clustering columns, and why
SELECT *without a partition key is a cluster-wide scan.
Vertical
usersid, name, email
user_profilesbio, avatar
Horizontal
Shard Auser_id 0–999
Shard Buser_id 1000–1999
Rows, partitions, and clustering
Cassandra tables are sorted maps: a partition key routes a row to a node; clustering columns order rows inside that partition.
Cassandra vocabulary
- Partition key — determines which node stores the data; keep partitions under ~100 MB.
- Clustering columns — sort rows within a partition (e.g. event time descending).
- Column family — logical grouping of columns; think wide rows, not skinny SQL tables.
- Tunable consistency — per-query
ONE,QUORUM, orALLdepending on freshness needs.
CREATE TABLE order_events (
order_id UUID,
event_time TIMESTAMP,
event_type TEXT,
payload TEXT,
PRIMARY KEY (order_id, event_time)
) WITH CLUSTERING ORDER BY (event_time DESC);
VaultCommerce's order timeline query — "show status history for order X" — hits one partition keyed by order_id. No cross-partition join required.
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 3 sections
- Query-first table design
- Write path and compaction
- Operational trade-offs
Test yourself
Answer these before moving on — recall is what makes it stick.