Apache Cassandra
maang.io System Design Series
Apache Cassandra is a masterless, wide-column database built for enormous write volume and always-on availability. It marries Dynamo's distribution (a consistent-hashing ring, leaderless replication, tunable consistency) to Bigtable's storage (the LSM-tree engine). No single point of failure, linear scale by adding nodes, and a consistency dial you turn per query — it's the self-managed cousin of DynamoDB and a system-design interview staple.
This deep dive comes in four parts:
- Foundations & Core Concepts — the masterless ring, partition keys, and replication factor.
- Internals — the write path (commit log → memtable → SSTable) and the LSM storage engine, with worked numbers.
- Advanced Internals — the read path, tunable consistency (
R + W > RF), repair, and tombstones. - Interview — Staff/Principal Q&A: data modeling, consistency reasoning, and failure handling.
Apache Cassandra — Part 3: Read Path, Consistency & Repair
maang.io System Design Series
What is this?
Part 2 left our corner-shop keeper with a fast way to receive goods — scribble the log, drop it in the tray, refile later. But now a customer walks in asking for a specific item. The keeper might find a fresh copy in the counter tray, an older copy on shelf 3, and a "we're out of that" sticky note from last week — and has to reconcile all of it into a single honest answer: what's the current truth? And because every item is stocked in three shops, the co-op also needs a way to answer "what if the three shops disagree?" — plus a way to quietly get them back in sync.
That reconciliation is Cassandra's read path and its consistency machinery, and it's where the masterless design earns its keep. This is the deepest, most interview-relevant chapter. Two ideas run through all of it:
The one-line idea: every value carries a timestamp, and the truth is simply the latest write wins. Consistency isn't a fixed property of the database — it's a dial you turn per query by choosing how many replicas to talk to, governed by one small inequality: R + W > RF.
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson