Apache Cassandra explained: replication, consistency levels, and tombstones
Apache Cassandra spreads data across nodes and replicates it so requests can continue when some nodes are unavailable. In return, it does not provide arbitrary joins or cross-partition transactions as a relational database would, and operators must choose replica response requirements and run repair. Having replicas does not mean every read always returns the newest value.
Apache Cassandra spreads data across nodes and replicates it so requests can continue when some nodes are unavailable. In return, it does not provide arbitrary joins or cross-partition transactions as a relational database would, and operators must choose replica response requirements and run repair. Having replicas does not mean every read always returns the newest value.
Scope: self-managed Apache Cassandra 5.0, based on official documentation checked November 23, 2026. Cloud services can differ. Examples are explanatory; no cluster was run or benchmarked.
How does Cassandra distribute data?
Cassandra hashes a table's partition key into a token and uses the token ring to select nodes. A keyspace's replication strategy and replication factor (RF) determine how many copies each partition has. With RF=3 in one datacenter, each partition has three replicas. A coordinator forwards a request to the relevant replicas; there is no single fixed write-primary for the whole cluster.
This can leave request paths available during some node failures, but the application must model access around partition keys. Efficient ordinary reads specify the partition key. Cassandra is not designed for arbitrary joins or atomic transactions across partitions. This article focuses on how replicas respond and converge, rather than general wide-column schema design. Architecture · Dynamo design
What do consistency levels change?
A consistency level (CL) sets how many replica responses Cassandra waits for before acknowledging an operation. For RF=3 in one datacenter, LOCAL_QUORUM writes wait for two replicas. A LOCAL_QUORUM read against the same replica set also waits for two, so the response sets overlap on at least one replica. That overlap helps the read coordinator find a recent write.
For example, if one of three replicas is temporarily unavailable, a LOCAL_QUORUM read or write can proceed with the other two. ONE can respond after one replica and may reduce latency, but that replica may not yet have the latest change. Quorum overlap is conditional on the same replica set and datacenter scope, and appropriate timestamp handling; it does not make every client, datacenter, concurrent write, or lightweight transaction globally strongly consistent.
Ordinary writes converge across replicas over time. For certain single-partition conditional updates, Cassandra also offers Paxos-based lightweight transactions (LWT), which provide linearizable compare-and-set behavior with additional coordination cost. Use them when the condition must be checked atomically, rather than for every write. Choose read and write CLs together with RF, replication strategy, and datacenter layout. Guarantees
How is a write stored?
Cassandra uses an LSM (Log-Structured Merge) storage engine optimized for writes. A node appends a mutation to its commit log and applies it to an in-memory memtable. When flushed, the data becomes an immutable SSTable on disk. The commit log supports recovery after a failure; an SSTable is not edited in place.
Updates can therefore leave versions of a row in several SSTables. Compaction merges files, selects current values and processes deletion markers into new SSTables. This adds disk I/O and write amplification, and affects reads as well as writes. Write throughput alone does not describe storage cost. Storage engine · Compaction
Why can a deleted value leave a tombstone?
Because SSTables are immutable, Cassandra cannot immediately erase an old row from a disk file. It writes a tombstone, a deletion marker that can be replicated and tells reads to ignore older data still present elsewhere. TTL expiry can also produce tombstones. Compaction merges SSTables, but a tombstone can only be discarded safely when older replicas will not reintroduce the deleted value.
Hints are best effort and do not guarantee that every missed write reaches a returning node. Repair compares common token ranges and streams differences to synchronize replicas. If a tombstone disappears before a long-offline replica learns about the deletion, its old value can return as “zombie” data. Plan repair and tombstone retention together; exact schedules depend on version, topology, and workload. Compaction and tombstones · Repair
When might Cassandra fit?
Consider Cassandra when large volumes of key-oriented data need distribution across nodes, high write throughput, availability during some failures, or low-latency access across regions—and the application can express queries by partition key. Another database may be simpler when arbitrary joins, foreign keys, atomic business transactions across partitions, or a globally newest value on every response are central requirements. These are selection criteria, not a benchmark claim.
| Need | Consider | Trade-off |
|---|---|---|
| Continue during some node failures | RF and request CL for the failure scope | Availability does not mean every response is newest |
| High write rate and partition-key reads | LSM path, token distribution, query-driven tables | Manage compaction I/O, skew, and partition size |
| Deletes or TTL | Tombstones, compaction, and repair schedule together | Late repair can let deleted values reappear |
| Related updates | Check single-partition LWT support | No arbitrary cross-partition transactions or joins |
Before adoption, check that representative queries use partition keys, decide how many replicas must respond during failures, and assign ownership for repair and recovery. A higher RF alone does not solve consistency, backup, or recovery design.
Scope and official sources
Apache Cassandra 5.0 documentation was checked on November 23, 2026. This introduction does not replace version-specific configuration, recovery procedures, or performance tuning.
[Architecture overview](https://cassandra.apache.org/doc/stable/cassandra/architecture/overview.html)
[Dynamo design](https://cassandra.apache.org/doc/stable/cassandra/architecture/dynamo.html)
[Consistency guarantees](https://cassandra.apache.org/doc/stable/cassandra/architecture/guarantees.html)
[CQL keyspaces and replication](https://cassandra.apache.org/doc/stable/cassandra/developing/cql/ddl.html)
[Storage engine](https://cassandra.apache.org/doc/stable/cassandra/architecture/storage-engine.html)
[Compaction](https://cassandra.apache.org/doc/stable/cassandra/managing/operating/compaction/overview.html)
[Repair](https://cassandra.apache.org/doc/stable/cassandra/managing/operating/repair.html)