NoSQL · Data models beyond tables
How does Cassandra's architecture work?
Short answer
Cassandra is a leaderless, partitioned, replicated store. Nodes form a ring, a partitioner assigns data, and writes go to a commit log and memtable before being flushed to immutable SSTables.
Every node can coordinate a request. The partitioner hashes the partition key to a token, and the ring determines which nodes own that token range. Replication factor controls how many nodes store each range, and the coordinator forwards to the replicas.
The write path
- Append the mutation to the commit log for durability
- Write to the in-memory memtable, which is sorted by key
- Flush the memtable to an immutable SSTable on disk
- Compaction merges SSTables and removes tombstones
- Hints and repair bring lagging replicas back into sync
nodetool status
nodetool ring
nodetool tablestats keyspace.table
nodetool compactionstats
nodetool repair keyspace tableThe storage engine is log-structured: updates create new versions rather than modifying rows in place. A delete writes a tombstone, which must be kept until compaction and until the gc_grace_seconds window has passed so all replicas see it. Reading too many tombstones is a common performance problem.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1What is the role of the commit log?
- 2Why are SSTables immutable?
- 3What is a tombstone and why can it hurt reads?
- 4What does nodetool repair actually do?
Say it in the interview
Cassandra is leaderless and partitioned. A partitioner hashes the partition key to a token, and the ring maps that token to replicas. Writes append to the commit log and memtable, then flush to immutable SSTables, with compaction merging them later. Deletes become tombstones that must survive until every replica has seen them. Because there are no joins, the table design follows the query. Repair and compaction are ongoing operational work, not optional maintenance.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live NoSQL mock interview and get scored feedback on depth, clarity and confidence.