Skip to main content
PreparationZone Logo
PrepZone

PACELC — Beyond CAP

Even without partitions, latency forces consistency vs response-time trade-offs.

Pass checkpoint below

Why this matters

  • CAP alone misses the everyday latency vs consistency choices that dominate p99 dashboards.
  • Async replication — the default in most databases — is a PACELC trade-off, not a partition scenario.
  • Staff interviews expect PACELC after CAP: "What happens when the network is fine but you read from a replica?"
  • ShardPay documents PACELC per endpoint so API consumers know whether a 5ms read might be stale.
During partition (PAC)
AvailabilityAP — activity feed
ConsistencyCP — ledger
Normal operation (ELC)
LatencyFollower reads
ConsistencyLeader reads
If Partition then choose A or C; Else (normal operation) choose Latency or Consistency.

Beyond the partition

Even with a healthy network, ShardPay's read replica returns balances that trail the leader by 50–200ms. A merchant refreshing their dashboard after a large payout might see the old balance for one poll cycle. That is the EL branch of PACELC: Else (no partition), choose Latency over Consistency.

The PA/PC branch still matters when AZs split, but most incident tickets at ShardPay come from replica lag under load — not from formal network partitions.

PACELC branches

  • PA (Partition → Availability) — During a network split, favor serving requests even if replicas disagree. ShardPay's notification ingress in each region is PA: events buffer locally rather than block merchants when cross-region links flap.
  • PC (Partition → Consistency) — During a split, favor consistent answers over always-on responses. ShardPay's ledger shard is PC: minority replicas stop accepting writes until quorum returns.
  • EL (Else → Latency) — When the network is healthy, favor fast responses even if reads are slightly stale. ShardPay routes merchant history queries to async replicas with a 30s staleness budget — p99 drops from 40ms (leader) to 8ms (replica).
  • EC (Else → Consistency) — When the network is healthy, pay latency for fresh reads. ShardPay's GET /accounts/{id}/balance after a transfer uses readConcern=majority on the leader — every response reflects all committed debits.

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 · 2 sections

  • Mapping ShardPay endpoints to PACELC
  • Tunable consistency without a partition

Test yourself

Answer these before moving on — recall is what makes it stick.