Why this matters
- Mislabeling a store as "CP" or "AP" in interviews signals shallow understanding — real systems tune per operation.
- Production incidents during regional outages expose whether your consistency choices match user expectations.
- VaultCommerce runs CP-ish Postgres for money and AP-ish caches for browse — the mix is deliberate.
App writesINSERT / UPDATE
LeaderPrimary node
Replica 1Read traffic
Replica 2Read traffic
CAP in plain terms
CAP components
- Consistency (C) — every read returns the latest write (linearisable).
- Availability (A) — every request gets a response, even if not the freshest.
- Partition tolerance (P) — the system continues despite network splits between nodes.
When nodes cannot talk (partition), you must sacrifice C or A. In practice, partitions happen — datacenter links fail, AZs isolate, misconfigured firewalls drop packets.
Partition between EU and US replicas:
CP choice: reject reads/writes until quorum confirms leader
→ VaultCommerce payment service returns 503 (unavailable but consistent)
AP choice: serve stale data from local replica
→ VaultCommerce product browse shows yesterday's price until healed
PACELC — the everyday trade-off
If Partition, choose A or C; Else, choose Latency or Consistency.
Most of the time there is no partition — you still choose how fresh reads must be versus how fast they return.
| Aspect | Latency-first (EL) | Consistency-first (EC) |
|---|---|---|
| Typical store | DynamoDB (eventual), Cassandra (ONE) | Postgres primary, etcd |
| Read behaviour | Local replica, may be stale | Quorum or primary, fresher |
| VaultCommerce path | Recommendation feed, search facets | Checkout, inventory hold |
| User-visible risk | Stale banner, wrong count | Slower page, occasional 503 |
Typical store
Latency-first (EL)DynamoDB (eventual), Cassandra (ONE)Consistency-first (EC)Postgres primary, etcdRead behaviour
Latency-first (EL)Local replica, may be staleConsistency-first (EC)Quorum or primary, fresherVaultCommerce path
Latency-first (EL)Recommendation feed, search facetsConsistency-first (EC)Checkout, inventory holdUser-visible risk
Latency-first (EL)Stale banner, wrong countConsistency-first (EC)Slower page, occasional 503
The rest of this guide is part of Pro
Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.
Still to come · 3 sections
- Tunable consistency in practice
- Mapping stores to CAP/PACELC
- Designing for your consistency budget
Test yourself
Answer these before moving on — recall is what makes it stick.