NotesSystem

Cassandra

Also: Apache Cassandra

A wide-column database descended from Dynamo's design: leaderless replication with per-query tunable consistency and last-write-wins per cell.

Design choices

  • Leaderless Replication: any node coordinates a request and fans out to the key's replicas.
  • Quorum: consistency levels per query: ONE, QUORUM, LOCAL_QUORUM (majority in the local datacentre), EACH_QUORUM, ALL.
  • Last Write Wins: conflicts resolve per cell by write timestamp.
  • Hinted handoff: coordinators keep hints for a down replica up to max_hint_window (3 h default); best effort. The consistency level counts acknowledgements from the key's own replicas, and only ANY accepts a stored hint in place of one, so Cassandra's quorums are strict.
  • Read Repair: blocking, foreground repair on mismatched reads; background probabilistic repair was removed in 4.0.
  • Anti-Entropy: nodetool repair with Merkle trees; incremental by default.

Notable trade-offs

  • Repair is the operator's job: run it at least every 7 days with the default 10-day gc_grace_seconds, or deleted data can resurrect.
  • LWW means concurrent updates to the same cell lose data; model data so cells are written once or contention is rare.