How CP and AP Systems Work
HOW CP SYSTEMS WORK
A single leader accepts all writes. The leader replicates each write to followers and only commits when a majority acknowledges. In a 5 node cluster, majority is 3. Writes require 2 follower acknowledgments before returning success.
During a partition isolating 2 nodes from 3, only the 3 node side can form a majority. The isolated 2 nodes refuse writes and return errors. Clients see reduced availability, but the system never creates conflicting data.
Latency cost: Inter-region RTT of 50ms means writes take 50ms to 100ms. Within a region (1-2ms RTT), writes cost 5ms to 10ms at p99.
HOW AP SYSTEMS WORK
Data replicates to N nodes (commonly 3). You configure write consistency W and read consistency R. Setting W=1 and R=1 gives maximum availability: writes return after one node acknowledges (1-2ms), reads return from whichever replica responds first.
During partitions, all nodes continue accepting requests locally. Clients get sub-10ms responses even when zones cannot communicate. The trade-off: writes in an isolated zone will not immediately appear elsewhere. Systems reconcile later using background sync processes that compare replica states and fix inconsistencies.
THE NUMBERS
CP write latency: 5-30ms within region (quorum). AP write latency: 1-5ms (single node). This latency difference is measurable in every request.