Consistency, Availability, and Latency Tradeoffs
Strong Consistency in Relational Systems
Relational databases with a single primary (the server handling all writes) provide strong consistency: every read sees the most recent write. The trade-off is availability during failover, typically 10-30s. Within a region, commits take 1-5ms. Cross-region uses two-phase commit (2PC): coordinator asks all to prepare, commits if all agree, adding 50-150ms.
High Availability in NoSQL Systems
NoSQL uses leaderless replication (any node accepts writes) with quorum operations. Quorum means majority: with 3 replicas, 2 must acknowledge. Writes continue if one node fails. The cost is eventual consistency (clients may temporarily see different values). Latencies stay 1-5ms.
Distributed SQL: Bridging the Gap
Distributed SQL provides ACID with horizontal scaling via consensus (nodes vote to agree). Within region: 10-20ms. Cross-region: 50-150ms. Some offer tunable consistency: strong for critical ops, eventual for less critical.