What is the CAP theorem and how does it guide decisions?
A distributed store can guarantee only two of three during a network partition: Consistency (every read sees the latest write), Availability (every request gets a non-error response) and Partition tolerance (the system keeps working despite dropped messages). Since partitions are unavoidable in real networks, the real choice under partition is consistency vs availability.
- CP systems (HBase, ZooKeeper, etcd) reject requests to stay consistent, good for coordination and financial ledgers.
- AP systems (Cassandra, DynamoDB in some modes, Riak) stay available and reconcile later with eventual consistency, good for shopping carts, feeds and telemetry.
PACELC extends this: even without partitions you trade latency against consistency. Also mention tunable consistency (quorum reads/writes) and that most real systems are a hybrid per operation.