The Fundamental Trade-offs in Distributed Databases
Blog post from Cockroach Labs
Distributed databases like CockroachDB aim to provide fast transactions, regional survivability, and strong consistency, but they are constrained by the laws of physics and the mathematics of distributed consensus, making it impossible to optimize for all three simultaneously. The speed of light sets a latency floor for communication between geographically distant locations, while quorum-based replication ensures data consistency and durability by requiring a majority of replicas to confirm a write, introducing cross-region latency. Strong consistency, or linearizability, guarantees that all operations appear instantaneous and are serialized in a globally consistent order, but this requires careful coordination among replicas. The fundamental challenge, known as the "Impossible Trinity," states that low-latency writes, regional failure survivability, and strong consistency cannot all be achieved at once. CockroachDB allows users to balance these factors according to their needs, offering flexibility in managing performance, consistency, and resilience.