Skip to main content

PACELC

1. Executive Summary​

PACELC extends the CAP framing to a question architects face far more often than a full network partition: What tradeoff do we make between latency and consistency when the network is healthy?

Daniel Abadi (2012) proposed:

If there is a Partition, choose between Availability and Consistency; Else (normal operation), choose between Latency and Consistency.

CAP—formalized by Gilbert and Lynch—addresses behavior during partition. PACELC argues that production systems spend most of their time in the else branch, where synchronous replication, quorum reads, and cross-region coordination increase consistency at the cost of latency (and often throughput). Conversely, asynchronous replication, local reads, and cached views reduce latency but weaken consistency guarantees.

This chapter formalizes PACELC relative to the CAP Theorem, maps the acronym to client-visible consistency models, surveys production PA/EL, PA/EC, PC/EL, and PC/EC postures with explicit caveats, and prepares you for principal-level interviews where "we are AP" is insufficient without stating normal-case staleness and latency budgets.

2. Why This Topic Matters​

Teams that stop at CAP often make two mistakes:

  1. Partition obsession — Designing only for split-brain while ignoring daily cross-AZ and cross-region latency costs of strong consistency.
  2. Label substitution — Calling a database "AP" without specifying read consistency levels, replication lag, or session guarantees.

PACELC forces a second axis:

BranchQuestion
PAC (partition)When isolated, do we fail closed (PC) or keep serving (PA)?
ELC (else)When connected, do we pay coordination cost for freshness (EC) or favor fast local responses (EL)?

Principal architects own SLIs that span both branches: p99 read latency during normal operation and error rates during regional failures. Interviewers use PACELC to see whether candidates understand that Spanner, Dynamo, and PostgreSQL read replicas differ primarily on the ELC axis, not only on CAP letters.

3. Problems Being Solved​

ProblemPACELC framing
Cross-region write latencyEC: synchronous multi-region commit; EL: async replication
Stale read replicasEL: read from local replica; EC: quorum or leader read
User-visible "flapping"PA during partition may amplify EL paths that were hidden before
Cost of strong consistencyEC often means more WAN round-trips and lower write throughput
Product expectations"Real-time" features may require EL; financial correctness requires EC
Technology comparisonCompare Dynamo vs Spanner on both PAC and ELC, not one label

PACELC does not replace formal consistency definitions (linearizability, causal consistency, eventual consistency). It organizes engineering tradeoffs around two operating modes: partitioned vs not.

4. Assumptions and System Model​

PACELC inherits CAP's partition assumptions from Gilbert and Lynch:

  • Asynchronous network in the worst case; partial synchrony in healthy datacenters.
  • Replicated state across multiple nodes or regions.
  • Clients observe latency and consistency through API semantics, not through internal labels.

For the ELC branch, assume:

  • No complete partition between the replicas involved in an operation (otherwise you are in the PAC branch).
  • Latency is end-to-end: replication, quorum round-trips, clock uncertainty (where applicable), and queueing.
  • Consistency must be named precisely: linearizability, sequential consistency, causal consistency, read-your-writes, monotonic reads, or bounded staleness.

PACELC is a design lens, not a theorem with a single published proof like CAP. Treat ELC tradeoffs as quantitative and workload-dependent—avoid inventing universal latency numbers.

5. Essential Terminology​

TermDefinition
PACELCIf Partition → A vs C; Else → Latency vs Consistency (Abadi, 2012).
PAC / ELCShorthand for the two decision branches.
PA / PCDuring partition: availability-first vs consistency-first (same as AP/CP in CAP language).
EL / ECElse: latency-first vs consistency-first normal operation.
Synchronous replicationCommit waits for acknowledgment from remote replica(s)—EC-leaning.
Asynchronous replicationCommit local before remote catch-up—EL-leaning.
Quorum readRead contacts multiple replicas to bound staleness—EC-leaning.
Local readRead from nearest replica without cross-check—EL-leaning.
RPO / RTORecovery point/time objectives—often correlate with EC vs EL replication.
Tail latencyp99/p999—often dominated by EC coordination on wide-area paths.

Notation in literature: Abadi writes systems as PA/EL (e.g., Dynamo) or PC/EC (e.g., Spanner). Some systems differ between reads and writes (e.g., PC/EC writes, PA/EL reads with session tokens).

6. Core Mechanism​

6.1 Two-level decision tree​

PACELC separates emergency partition policy from steady-state performance policy:

Figure 1: PACELC — partition branch (CAP) vs normal-operation branch (latency vs consistency).

6.2 Relationship to Gilbert & Lynch CAP​

During partition (PAC)Else (ELC)
CAP (Gilbert & Lynch)Proved: cannot have C and A for linearizable registerNot addressed by CAP theorem
PACELCSame CP vs AP choiceAdds L vs C engineering tradeoff
Formal statusTheorem (async, single register)Design framework; depends on chosen consistency definition

CAP tells you you must sacrifice C or A when partitioned. PACELC adds that without partition, you still choose how much coordination to pay for C—there is no free strong consistency at minimum latency across distant replicas.

6.3 ELC as a consistency–latency spectrum​

Figure 2: Normal operation is not binary; many production systems expose tunable points on the spectrum.

Mechanisms on the EC side:

  • Synchronous multi-AZ fsync and replication (e.g., PostgreSQL synchronous standby).
  • Raft/etcd quorum reads and writes.
  • Spanner: Paxos quorums + TrueTime for external consistency.
  • Cassandra QUORUM / ALL reads and writes.

Mechanisms on the EL side:

  • Async replication to read replicas (PostgreSQL, MySQL).
  • Cassandra ONE / LOCAL_ONE.
  • CDN and edge caches with TTL.
  • Leaderless reads with high staleness probability.

6.4 PAC interacts with ELC​

A system configured for EL (async replicas) may appear highly available during partition because each region serves local traffic—but divergence is larger than an EC system that would have failed closed (PC) on the minority side.

Figure 3: EL during normal operation amplifies staleness visible under partition (PA).

7. Step-by-Step Walkthrough​

Scenario: Global document editing API with US and EU regions.

  1. Requirements gathering

    • Metadata (permissions): must be linearizable → EC candidate.
    • Document body: collaborative editing with merge → EL with CRDTs acceptable.
  2. Normal operation — ELC choices

    • Permissions service: etcd or Spanner-style quorum in one region; cross-region sync writes → EC (higher write latency).
    • Document content: Write to regional leader; async replicate to EU → EL (lower write latency; EU reads may lag).
  3. Partition — PAC choices

    • Permissions: Minority region stops granting new permissions → PC.
    • Content: Both regions continue edits → PA; merge on heal via CRDT.
  4. Client contracts

    • Session token binds user to region for read-your-writes where needed.
    • Explicit 409 / conflict payloads on permission changes during partition.
  5. Operations

    • Monitor replication lag (EL path) and quorum health (EC path) as separate alerts.

7.1 Real-World Scenarios at Production Granularity​

PACELC asks two questions per operation: (1) PAC — what happens when partitioned? (2) ELC — what latency vs consistency tradeoff on normal days? The scenarios below specify both branches, client-visible behavior, and operator actions minute by minute.

Scenario A: Shopify e-commerce — hybrid PC/EC + PA/EL in one platform​

Context: Checkout and inventory require correctness; product catalog and search tolerate staleness. Shopify-style architectures split PACELC per bounded context, not per company.

ServiceNormal (ELC)Partition (PAC)Why
Order / paymentEC — sync commit to primary + durable outboxPC — fail closed without quorumOversell and double-charge unacceptable
Product catalogEL — read from regional replica / CDNPA — serve stale catalog locallySpeed > perfect freshness
Search indexEL — async index from CDCPA — regional index may lagEventual convergence OK

Granular checkout flow (normal operation — EC path):

TimeEventELC
T+0User clicks "Buy" in US-East—
T+20msAPI validates inventory via EC reservation service (quorum / row lock)EC — pays ~1–3 AZ RTT
T+45msOrder row committed on primary; outbox event written in same txnEC
T+50ms201 Created returned to clientLow write latency because single-region EC
T+200msAsync CDC replicates to EU catalog replicaEL for EU readers

Same user, catalog read immediately after (EL path):

TimeEventELC
T+55msUser views "My orders" from EU edgeRouted to EU read replica
T+60msOrder missing from list (replication lag 2–5s)EL — stale read
T+3sOrder appears after async catch-upEL converges

Mitigation without full EC everywhere: Session token routes post-checkout reads to origin region (read-your-writes without global EC).

See: Shopify Transactional Outbox.


Scenario B: Netflix streaming — PA/EL for metadata reads, PC/EC for billing​

Context: 99% reads (title metadata, recommendations); writes rare (account, entitlements). Normal operation optimizes EL; entitlements use EC.

OperationPACELCNormal latency driver
Play manifest / title metadataPA/ELCDN + regional cache; no cross-region quorum
Subscription entitlement checkPC/ECAuthoritative account DB; sync or leader read
Viewing history writePA/ELAsync aggregate; merge on conflict OK

Granular "Start playback" flow:

TimeEventBranch
T+0User presses Play in Berlin—
T+15msEdge POP serves manifest from local cacheEL
T+25msEntitlement API checks account in US-West leaderEC — cross-Atlantic RTT on critical path
T+120msEntitlement OK; stream startsEC tax on ~1% path
T+121msViewing event queued locallyEL — async to analytics

Partition — EU isolated from US account DB:

SidePACUser experience
EU edgePA for metadataPlayback from cache continues
EntitlementPC without quorumNew plays blocked — fail closed
Wrong PA/EL on entitlementsWould allow piracyRevoked subs still play

Principal signal: EL for bulk reads; EC only on the small critical path that gates revenue and compliance.

See: Netflix Cascading Failure.


Scenario C: Google Spanner — canonical PC/EC normal and under partition​

Context: Spanner synchronously replicates via Paxos per shard; TrueTime bounds external consistency. PC/EC in both branches.

Normal write (ELC = EC):

TimeEventCost
T+0INSERT into orders (multi-region instance)—
T+1msPaxos prepare/accept across replicas in 3 regionsEC — WAN RTTs in quorum
T+8–15msCommit wait for TrueTime safe timeEC — clock bound
T+16msACK to clientWrite latency >> single-region Postgres

Normal read with staleness bound:

SettingELCBehavior
Default (strong)ECRead at latest commit timestamp
max_staleness=10sEL-leaningCheaper replicas; bounded staleness SLO
Read-only replicaELLower latency; explicit staleness contract

Partition — minority region loses quorum:

Region rolePACBehavior
Majority (2 of 3)PC servesReads/writes continue
Minority (1 of 3)PC blocks503 / unavailable — sacrifices A
Misconfigured dual-writeSplit brainNot Spanner — fencing via Paxos epoch

See: Google Spanner Global Consistency.


Scenario D: PostgreSQL active-passive — PC/EC vs PC/EL via replication mode​

Context: Same product, different PACELC posture depending on synchronous_standby_names and read routing.

Configuration 1: Sync standby (PC/EC for writes)

TimeEventELC
T+0UPDATE accounts SET balance=...—
T+2msPrimary fsync—
T+4msSync replica ACK required before commitEC
T+5msClient receives COMMIT+2ms vs async

Configuration 2: Async replica + read from replica (PC/EL)

TimeEventELC
T+0Write to primaryEC on write path (local)
T+3msCOMMIT on primaryFast write
T+4msRead from async replicaEL — may lag 100ms–30s
T+4msUser sees old balanceEL staleness without partition

Failover promotion (async) — PAC + ELC interact:

TimeEventEffect
T+0Primary AZ failsPAC — writes unavailable (RTO window)
T+90sReplica promotedPA restored on new primary
T+91sLast 20s of commits lostEL async lag → RPO; users see C violation

Fix for read path: Route sensitive reads to primary or use pg_current_wal_lsn() lag check before replica read.


Scenario E: Uber ride matching — EL geolocation, EC trip state machine​

Context: Driver GPS updates are high-volume (EL); trip lifecycle (requested → matched → completed) needs EC to prevent double assignment.

DataNormal ELCPartition PAC
Driver locationEL — write to regional cell; 1–2s staleness OKPA — local cell keeps updating
Trip stateEC — single leader per trip IDPC — minority cell rejects state transition
Surge pricingEL with short TTLPA — regional surge may diverge briefly

Granular match flow (normal):

TimeEventELC
T+0Rider requests trip in SF—
T+50msDispatch reads driver locations from regional cache (EL)Sub-second stale positions OK
T+80msASSIGN driver-42 via EC trip service (leader shard)Linearizable compare-and-set
T+85msDriver app shows new tripEC prevents two riders on same driver

Partition — dispatch cell split:

CellPAC for locationsPAC for trip state
US-West majorityPA — EL updatesPC — commits
US-West minorityPA — isolated ELPC — rejects ASSIGN

Double-assign risk if trip state were EL: Two cells both read driver-42=idle from stale cache and assign — why trip state must be EC/PC.

See: Uber Ride Matching.


Scenario F: Slack messaging — EL delivery with session and causal guarantees​

Context: Messages fan out to millions of channels; global linearizability per message is unnecessary; session consistency and ordering within a channel matter.

OperationPACELCMechanism
Post messagePA/EL normalWrite to regional leader; async fan-out
Read channel historyEL with monotonic readsPer-user cursor; sticky to region
Workspace admin revokePC/ECStrong metadata store

Granular send + read (normal — EL):

TimeEventELC
T+0User posts in #eng from NYC—
T+25msACK after regional persistEL — not waiting for Dublin replica
T+30msSame user reads #engSession — sees own message (read-your-writes)
T+200msDublin teammate reads #engEL — message may not appear yet
T+400msDublin sees messageReplication lag

Partition — US and EU cells isolated:

BehaviorPACELC symptom
Both cells accept postsPADuplicate message IDs if not careful — need vector clocks / server IDs
EU reads US channelPAEL backlog; ordering conflicts on heal
Admin disables user in USPC on metadataEU may still show user active until replicate — EL security lag

See: Slack Message Delivery.


Real-world PACELC posture summary​

System / pathNormal (ELC)Partition (PAC)Latency vs consistency tradeoff
Shopify checkoutECPCPays quorum RTT; no oversell
Shopify catalogELPAFast reads; lag under load
Netflix metadataELPACDN hit; stale OK
Netflix entitlementsECPCCross-region on critical path
Spanner (default)ECPCWAN write latency; strong reads
Postgres async replicaEL readsPC writesCheap reads; lag incidents daily
Uber GPSELPAVolume over freshness
Uber trip stateECPCCorrectness over speed
Slack messagesEL + sessionPAFan-out speed; merge on heal

7.2 PACELC in Active-Passive, Active-Active, and Disaster Recovery​

Failover topology determines both branches: ELC during steady state (replication lag, read routing) and PAC during isolation (who keeps serving, who blocks). DR metrics map directly to PACELC.

DR vocabulary mapped to PACELC​

TermELC interpretation (normal)PAC interpretation (partition / failover)
RPOMax EL replication lag at failure timeAfter promotion, reads reflect data at least RPO stale
RTON/AWindow where PC blocks writes or PA unavailable
Sync replicationEC — commit waits for remote ACKPC — minority rejects; RPO ≈ 0
Async replicationEL — fast local commitPA on promote side; lost writes = EL lag
Active-passiveStandby often EL for reads (async) or EC (sync)Single writer → PC-lean on promotion
Active-activeBoth sides EL for local writesPA risk — divergence unless global EC
Read replicaEL by definitionPromote replica → inherit lag as RPO

Topology 1: Single-region active-passive (hot standby)​

Architecture: Primary AZ-a serves writes; standby AZ-b replicates synchronously or asynchronously.

Normal operation — ELC choices​

ReplicationWrite path ELCRead from standby ELCTypical p99 write
SynchronousECEC if sync caught up+1 AZ RTT (~1–2ms)
AsynchronousEL (local commit)EL — lag variableBaseline primary only
Async + primary reads onlyEL replicateEC for routed readsBest of both for read-your-writes

Granular day-2 incident (async EL, no partition):

TimeEventUser sees
T+0Heavy write load; replication lag climbs to 8s—
T+1minUser updates profile; reads from replicaStale avatar — ELC incident, not PAC
T+2minAlert: replica_lag_seconds > 5Ops throttle replica reads
T+5minLag recoversEL path self-heals

Failover — PAC behavior​

StepSync (PC/EC)Async (PC/EL)
1. Primary failsWrites unavailable ~30–120sSame
2. Fence primaryPC — prevent split brainPC
3. Promote standbyEC preserved; RPO ≈ 0EL lag lost; RPO = lag at failure
4. Resume trafficPA restoredPA restored; clients may see missing recent writes

PACELC interview answer: "Single-region active-passive with async replication is PC/EL: normal writes are fast (EL), reads from standby are stale (EL), failover is PC-lean with brief unavailability, and promotion exposes EL lag as RPO — not a partition theorem issue but a consistency bound."


Topology 2: Multi-region active-passive (DR standby)​

Architecture: US-East active; EU-West warm standby. Cross-region async replication (typical) or sync (Spanner/RDS global).

Normal operation — ELC by configuration​

ConfigUS-East usersEU users routed to USReplication
Async DREC local writesEL reads if using EU cache/replica100ms–minutes lag
Sync cross-regionECEC but +WAN RTT every writeRPO ≈ 0
Read-local-write-globalWrite US EC; EU read local ELCommon hybridProduct complexity

Granular normal-day EU user (async DR — PC/EL):

TimeEventELC
T+0EU user loads dashboardEL — cached in EU; 30s stale
T+1sUS user updates same recordEC on US primary
T+2sEU user refreshesStill stale — EL lag 45s
T+46sEU sees updateEL converged

Regional disaster failover​

PhaseActionPACELC effect
DetectUS-East unreachable—
FenceBlock US-East writes if partially alivePC — protect against split brain
PromoteEU-West becomes primarySwitch from EL follower to EC leader
RedirectDNS → EUPA restored for EU; US users pay WAN latency
OperateEU serves all writesEC local; former US data EL-stale up to RPO

Client experience — RPO = 5 minutes (async DR):

UserBefore failoverDuring promotion (RTO 10 min)After failover
USUS-East PC/EC503 / timeoutEU PC/EC; writes may lose last 5 min
EUUS-primary writes (high latency)503EU-local EC writes (fast); reads fresh for new writes

RPO = 0 (sync cross-region — PC/EC):

  • Every commit waits for EU ACK — EC normal operation (+50–150ms WAN per write).
  • US-East total loss: EU already has all commits — promotion is PC/EC with no EL data loss.
  • Partition between regions: PC — global write stop on minority (Spanner model).

See: AWS S3 Multi-Region DR.


Topology 3: Multi-region active-active​

Architecture: US-East and EU-West both accept reads and writes; bidirectional async replication (default) or global Spanner.

Normal operation — PA/EL (typical async active-active)​

UserWrite ELCCross-region read ELC
US user → US-EastEL — local commit ~5msN/A
EU user reads US-written row—EL — 200ms–30s lag typical
EU user → EU-West write same rowELConflict risk — LWW or app merge

Granular conflict (normal, no partition):

TimeUS-EastEU-WestELC
T+0title = "Hello"Replicating—
T+100ms—title = "Bonjour" (concurrent)Both EL ACK
T+5sLWW: "Bonjour" wins—EL convergence, not EC
StrategyNormal wasPartition PACCombined symptom
Default async A-APA/ELPA both sidesLarge divergence; merge on heal
Global SpannerPC/ECPC minorityMinority unavailable; no divergence
Per-user home regionEL localPA per cellReduces cross-partition writes
Leader per shardEC per keyPC per shardUber/Spanner pattern

Granular partition timeline (PA/EL active-active):

TimeUS-EastEU-WestPACELC
T+0inventory=100 replicatedSameEC at last sync point
T+1Partition——
T+2Sell 60 → 40 (EL local ACK)Not visiblePA + EL
T+3—Read 100 (EL stale)EL amplifies under PA
T+4—Sell 60 → 40PA — both sides sold 120 units
T+1hHealReconcile — oversellEL lag + PA = worst case

Mitigations and PACELC shift:

MitigationNormal ELCPartition PAC
Inventory service (single leader)ECPC
CRDT cartELPA — commutative merge
Spanner global DBECPC
Saga + reservationEC reserve, EL catalogPC on reserve

Failover scenario matrix (PACELC lens)​

ScenarioTopologyNormal ELCFailover PACKey risk
Replica lag alertActive-passive asyncELN/AStale reads without partition
Single AZ failureActive-passive syncECPC briefRTO window
Single AZ failureActive-passive asyncELPC promoteRPO = lag
Region disasterActive-passive DR asyncEL cross-regionPromote PC/EC EURPO staleness
Region disasterActive-passive DR syncECPC/EC promoteGlobal write stop if partitioned
DNS failover onlyAnyUnchangedRouting onlyEL stale data in target region
Active-active partitionMulti-regionPA/ELPA bothDivergence + EL staleness
Active-active + SpannerMulti-regionPC/ECPC minorityLatency cost daily
Failback to old primaryDREL backlogMust fenceStale EL writes replay
Cold restore from backupBackup DRN/APA after restoreHours of EL gap = RPO

Active-passive vs active-active — PACELC decision guide​

RequirementActive-passiveActive-active
Lowest normal write latency (local)✗ Single primary may be far✓ EL local writes
Lowest cross-region read staleness✓ Single source of truth✗ EL unless EC global
Simplest ELC mental model✓ One primary, predictable lag✗ Per-region lag + conflicts
RPO = 0 without global write penalty✓ Sync to standby (same region)✗ Needs PC/EC global (Spanner)
Financial / inventory correctness✓ PC/EC naturalNeeds EC layer per entity
Partition behaviorPC-leanPA/EL risk by default

Principal recommendation — PACELC per data type:

Data typeTopologyNormal ELCPartition PAC
Money, inventory, trip stateActive-passive or shard leaderECPC
Catalog, feeds, analyticsActive-active replicasELPA
Session / cartActive-active + CRDTELPA + merge
Global config / ACLSingle-region PC/EC + cacheEC origin, EL edgePC

DR drill — PACELC checklist​

Before drill:

  • Document per-API: EL or EC during normal operation
  • Document per-API: PA or PC during partition
  • Map RPO to measured replication_lag_p99 (EL bound)
  • Map RTO to expected PC unavailability window
  • Verify read routing: replica reads flagged as EL in runbooks

During drill:

  • Measure write unavailability (PAC / RTO)
  • Sample reads from promoted region — compare to pre-failover writes (EL lag vs RPO)
  • Confirm fenced old primary cannot accept writes (PC)
  • Track p99 write latency before/after — did you shift from remote EC to local EC?

After drill:

  • Reconcile rows diverged under PA/EL test
  • Failback only after replication caught up (EL → EC safe)
  • Update ADR with observed lag, RPO, RTO, and PACELC quadrant per service

See also: CAP Theorem — HA/DR scenarios, Disaster Recovery and Multi-Region, Google Spanner, Amazon DynamoDB.


8. Invariants and Guarantees​

PACELC does not prove new impossibility results. It organizes guarantees:

ConfigurationPartition invariant (PAC)Normal invariant (ELC)
PA/ELResponses on all sides; divergence possibleLow latency; staleness bounded only by replication lag
PA/ECRare in practice; EC usually requires coordination that partition breaksStrong when connected; degrades to PA under partition
PC/ELConsistent when available; minority unavailableFast reads may be stale even when connected
PC/ECLinearizable when quorum availableStrong consistency; higher latency

Architectural invariants to document:

  1. Maximum staleness (EL) or consistency level (EC) per API.
  2. Behavior when lag exceeds SLO (fail read vs serve stale).
  3. Conflict resolution rules when PA allows concurrent writes.

9. Failure Scenarios​

ScenarioPAC effectELC effectCombined symptom
Async lag under loadN/A (no partition)EL reads return old data"Bug" reports without partition
Regional partitionPA continues in both regionsPrior EL config → large divergenceMerge conflicts, support tickets
Quorum lossPC rejects writesEC path unavailableApparent outage though nodes "up"
Clock skew (EC with clocks)N/AFalse confidence in orderingViolations if bounds exceeded
Hot key on single leaderN/AEC writes serialize on leaderLatency spikes—not CAP, but ELC cost

Gray failures: Elevated latency without clean partition may push operators toward PA responses while EC logic still assumes quorum—undefined middle ground unless explicitly designed.

10. Performance Characteristics​

PACELC is not a benchmark framework. Describe performance qualitatively:

ELC choiceTypical latency driverThroughput note
EL — local readSingle replica RTTHigh read throughput; staleness risk
EL — async writeLocal commit onlyFast writes; RPO > 0 on failure
EC — quorum readMax or sum of replica RTTsFewer stale reads; tail latency sensitive
EC — sync cross-region writeWAN RTT per commitWrite throughput limited by distance

Tail latency: EC across regions often dominates p99; EL shifts risk to consistency rather than median RTT. In practice, teams discover ELC tradeoffs during capacity planning: doubling read traffic by adding EL replicas is cheap until product requirements demand read-your-writes across regions—then EC coordination re-enters the critical path.

Do not cite fabricated ms numbers for "AP vs CP"—measure for your topology, payload size, and consistency level.

11. Scalability Limits​

  • EC write path — Single leader or quorum per shard caps write scalability; Spanner uses shards; still pays coordination per transaction scope.
  • EL read scaling — Add read replicas freely; consistency does not scale independently of staleness.
  • PA multi-master — Write scalability across regions increases conflict rate—application merge cost becomes the limiter.
  • Metadata PC/EC — Small strongly consistent control plane does not scale data plane; hybrid architectures use EL for bulk data.

Sharding multiplies PACELC decisions: each shard has its own PAC and ELC posture.

12. Operational Considerations​

  1. Separate dashboards for replication lag (EL) and quorum health (EC).
  2. SLOs: Define p99 latency and max staleness separately; alert on both.
  3. Failover drills: EL systems need manual or automated conflict playbooks; PC systems need client retry to healthy partition.
  4. Config drift: Cassandra consistency level per query; changing defaults changes ELC without renaming the cluster.
  5. Documentation: Runbooks should say PA/EL explicitly, not "we use Dynamo."

Incident communication: "Elevated lag" is an ELC incident; "region isolated" is PAC—different mitigations.

13. Security Considerations​

  • EL replicas may serve data to clients in another trust zone before ACL revocation replicates—security consistency lags.
  • PA during partition may allow writes on a compromised partition if auth tokens cannot be revoked globally—pair PA with short-lived credentials where risk is high.
  • EC metadata for authZ reduces stale permission risk; worth latency for admin APIs.

PACELC is not a security model; it highlights where stale security state can appear.

14. Cost Considerations​

PostureCost pattern
EC cross-regionWAN egress per commit; more expensive instances for quorum; lower write QPS per dollar
EL multi-regionCheaper reads locally; higher app engineering for merge; support cost for inconsistency
Over-replication (EL)Storage and replication bandwidth without EC benefit if reads still local

FinOps should attribute cross-region sync as consistency tax (EC), not blame "the database" generically.

15. Production Implementations​

Abadi's original classifications (illustrative; verify per version and config):

SystemTypical PACELC labelNotes
Dynamo / CassandraPA/ELTunable consistency; default lean EL
BigtablePC/ELSingle-row atomicity; partition behavior CP-leaning
SpannerPC/ECSync replication; TrueTime
PostgreSQLPC/EC (sync) or PC/EL (async replica)Same product, different ELC via replication mode
MongoDBConfigurableWrite concern + read concern map to ELC
CockroachDBPC/EC-leaningRaft per range; survival goals
Redis with local replicasOften PA/ELAsync replication; manual failover risks

Hybrid (common): PC/EC for inventory ledger + PA/EL for browse catalog in one e-commerce platform.

16. Alternatives and Tradeoffs​

Approachvs PACELC
Explicit consistency modelsFiner than EL/EC binary (causal, sequential)
SLA: max_staleness=τOperationalizes EL with bound
CRDTsEL-friendly convergence without linearizability
Single-region strong + CDNAvoids WAN ELC for reads; partition scope shrinks
Calibrated PACELC (research)Extensions weight P, A, C, E, L differently—less common in interviews

When to emphasize ELC: Multi-region active-active, read-heavy global products, edge caching.

When to emphasize PAC: Control planes, financial cores, coordination services (locks, leases).

17. Common Misconceptions​

MisconceptionCorrection
"PACELC replaces CAP"PACELC extends CAP with the else branch; CAP proof still stands for partition.
"EL means inconsistent"EL means weaker guarantees; session/monotonic reads may suffice.
"EC means linearizable"EC means you paid coordination; define the actual model.
"AP databases are always EL"Consistency levels can make reads EC even in 'AP' stores.
"Partition is rare so PAC doesn't matter"Partitions are rare per hour but certain at scale; PAC must be designed.
"PACELC is a theorem"Framework for tradeoffs; ELC is not Gilbert & Lynch impossibility.
"Lower latency always wins"Business cost of stale financial or inventory data can exceed infra savings.

18. Principal Architect Perspective​

Present architecture as a 2×2 matrix per bounded context:

ELC: EL ELC: EC
PAC: PA [Dynamo-style] [unusual; hard to keep EC while PA]
PAC: PC [async + quorum [Spanner, etcd]
minority down]

Decisions:

  1. Split by API — Not one label per company.
  2. Quantify ELC — p99 write latency budget vs staleness SLO.
  3. Test PAC — Game days for regional isolation.
  4. Align stakeholders — Product owns merge UX for PA/EL; finance owns PC/EC for money.

Reject "we'll fix consistency later" on EL paths that already serve paying customers.

19. Architecture Review Exercise​

Prompt: A media company streams video metadata from 12 regions. Writes (title, ACL) are 1% of traffic; reads 99%. They propose PA/EL everywhere for "global speed."

Tasks:

  1. Classify metadata writes and reads separately on PACELC.
  2. Identify risks of PA for ACL changes during partition (piracy, revoked access still valid).
  3. Propose a hybrid: which operations move to PC/EC?
  4. Define monitoring for replication lag vs permission violations.
  5. Draft client semantics for read-after-write on title updates.

Deliverable: PACELC matrix + ADR for hybrid posture.

20. Whiteboard Explanation​

Draw 2×2:

EL (fast) EC (strong)
PA shopping cart (rare)
PC stale reads OK Spanner / etcd

90-second script: "CAP is only about when the network partitions. PACELC adds: what about normal days? If I synchronously replicate every write across regions before ACK, I get stronger consistency but pay WAN latency on every write—that's EC. If I ACK locally and replicate async, writes are fast but readers in another region see lag—that's EL. Dynamo is often described PA/EL: on partition keep serving, and normally favor latency. Spanner is PC/EC: quorum and sync replication, minority down on partition. Most real platforms are hybrid—strong metadata, fast content. PACELC beats CAP alone because interviewers and incidents care about both isolation behavior and everyday tail latency."

21. Interview Questions​

  1. Expand the PACELC acronym and explain each branch.

    • Signals: P→AC; Else→LC; partition vs normal.
  2. How does PACELC relate to Gilbert & Lynch CAP?

    • Signals: PAC = CAP; ELC not covered by theorem.
  3. Classify Dynamo and Spanner on PACELC.

    • Signals: PA/EL vs PC/EC; tunable caveats.
  4. Why is PA/EC uncommon?

    • Signals: EC needs coordination; partition breaks it → degrades to PA.
  5. Your app needs low-latency reads and strong writes—what PACELC posture?

    • Signals: PC/EC or PC/EL writes with leader; reads from leader or quorum for freshness; hybrid.
  6. What does EL mean for PostgreSQL read replicas?

    • Signals: Async lag; read-your-writes not guaranteed without routing.
  7. How would you test ELC assumptions?

    • Signals: Lag metrics, consistency integration tests, Jepsen-style workloads.
  8. Does PACELC say latency and consistency are always opposed?

    • Signals: In multi-replica geo setups, often yes for same object; caching complicates.
  9. Explain a hybrid PACELC architecture for e-commerce.

    • Signals: PC/EC inventory; PA/EL catalog; separate services.
  10. What is wrong with 'we chose AP so latency is solved'?

    • Signals: AP is partition; latency is ELC; consistency levels matter.
  11. How do Cassandra consistency levels map to ELC?

    • Signals: ONE vs QUORUM vs ALL; LOCAL_QUORUM.
  12. When would you accept PA/EL for financial data?

    • Signals: Never for balances; maybe for non-critical analytics; strong boundary.
  13. Active-passive async DR — how does RPO map to PACELC?

    • Signals: RPO = max EL replication lag; promotion exposes staleness bound.
  14. Why does active-active default to PA/EL?

    • Signals: Local commits without global quorum; fast writes; divergence on partition.
  15. Spanner in active-active multi-region — still PC/EC?

    • Signals: Yes; WAN latency daily (EC); minority unavailable on partition (PC).

22. Interview Follow-Ups​

  1. Design session guarantees without full linearizability. — Sticky sessions, version tokens, read-your-writes.
  2. Spanner TrueTime—EC enabler or separate axis? — External clock bounds; still PC/EC posture.
  3. CRDTs and PACELC. — PA/EL friendly; convergence vs strong invariants.
  4. Calibrate max staleness SLO from business requirements. — Revenue vs infra cost.
  5. Jepsen findings vs PACELC labels. — Implementation may violate claimed posture.
  6. Single-region multi-AZ: PAC or ELC? — AZ partition → PAC; ELC still applies cross-AZ sync choice.
  7. DR failover with 5-min RPO — ELC or PAC issue? — ELC lag bound becomes consistency loss; brief PAC during promotion.
  8. Can you have EC normal and PA partition? — Yes (Spanner); EC degrades to PC on minority, not PA on majority.

22A. Production Low-Level Design (Interview + Game Day)​

PAC/EL per operation—tune consistency level by query, not one global label. Production LLD and Game Day Standard.

Operation routing​

OperationPACELCConsistency level
Stock deductPC/ECQUORUM / serializable txn
Catalog browsePA/ELLOCAL_ONE + cache
Order statusPA/ECQuorum read or sticky session

Step-by-step flow:

StepPACELC branchTradeoff
1–2Else: LatencyFast stale browse
3–4Else: ConsistencyHigher RTT, safe deduct
5Partition: PC if neededMinority errors on deduct

SLO​

Browse p99 < 50ms (EL). Deduct: linearizable per SKU; 0 oversell incidents.


22B. Game Day Playbooks​

#DrillInjectDetectMitigateVerify
GD-1Oversell under LOCAL_ONEDeduct at CL=ONEInventory negativeForce QUORUM on deductNo negative stock
GD-2Partition + dual writeSplit regionsConflict / lost updatePC on deduct pathLedger correct
GD-3Stale browse SLO burnPause replicationLag dashboardThrottle cache TTLBrowse within SLO

GD-1 — EL browse vs EC deduct​

23. Strong Answer Example​

Question: "Compare Cassandra and Spanner for a global inventory system."

Answer this as a 45-minute design comparison using the PRACTICE framework. Below is how a strong student sounds aloud—score both on PAC and ELC, then decide for stock deduction vs catalog browse.

PRACTICE interview answer map for Cassandra vs Spanner inventory

Figure A: PRACTICE map — Problem → Requirements → Assumptions → Capacity → Topology → Invariants → Constraints → Evolution.


Student interview script (PRACTICE)​

P — Problem framing​

"We're choosing storage for global inventory—SKU stock that must not oversell. That's a safety problem, not just latency.

I'll compare Cassandra and Spanner with PACELC, not CAP slogans: If Partition → A or C; Else → Latency or Consistency.

Non-goals: calling either CA, or using Cassandra for stock because 'AP is faster.' Catalog browse can be a different store."

R — Requirements​

TypeRequirement
FRReserve / decrement / release stock; query available qty
NFRGlobal users; p99 deduct latency budget; no double-sell under lag or partition
PACDuring region isolation: minority must not commit sales without coordination (PC)
ELCOn healthy days: prefer EC for deduct (correct stock) even if WAN latency rises
Soft pathProduct catalog / search can be EL / PA

"I'll ask: multi-region active-active writers? Flash sales? I'll assume global SKUs, multi-region traffic, overselling is unacceptable."

A — Assumptions (state aloud)​

AssumptionWhy it matters
Inventory = critical pathPC/EC lean
Cassandra defaults lean PA/ELTunable via consistency levels
Spanner is PC/ECSync Paxos + TrueTime; minority unavailable
"Global inventory" ≠ one Cassandra CLApp design still matters
Hybrid OKStock service ≠ browse catalog

"Cassandra can be pushed toward quorum/SERIAL, but the default posture and operational footguns differ from Spanner's built-in external consistency."

C — Capacity (latency vs correctness)​

Stock deduct QPS (peak) → flash sale spikes
Spanner EC write → pays cross-region / quorum RTT (WAN ms)
Cassandra LOCAL_ONE read → low latency, possible stale stock → oversell risk
Cassandra QUORUM / EACH_QUORUM → closer to EC; latency ↑; still need careful LWT/SERIAL for CAS
Max staleness for deduct API → 0 (business rule)
Catalog browse → staleness of seconds OK

"I'd put numbers on the whiteboard: p99 commit latency we're willing to pay to never oversell."

T — Topology (draw this)​

PACELC Cassandra vs Spanner comparison

Figure B: Cassandra default PA/EL (tunable); Spanner PC/EC. Inventory deduct wants PC/EC; catalog can stay PA/EL.

AxisCassandra (typical)Spanner
P: partitionPA-lean (serve; diverge risk) unless app/quorum strictPC (minority down)
E: normalEL-lean (LOCAL_ONE)EC (sync + TrueTime)
Inventory fitRisky for stock without heavy CL + LWT designNatural fit for stock ledger
Catalog fitStrongOverkill / cost

Global inventory decision and hybrid

Figure C: Oversell risk → PC/EC stock path (Spanner or equivalent); catalog → PA/EL; measure p99 and chaos partition.

Recommendation I'd give:

  1. Stock reservation / decrement: Spanner (or similar PC/EC: Cockroach, per-SKU shard leader + quorum).
  2. Catalog / search / browse qty "about": Cassandra/Dynamo PA/EL with lag SLO.
  3. If forced to Cassandra for stock: QUORUM/SERIAL (LWT), single logical writer per SKU where possible, chaos-test partitions—and still explain residual risk vs Spanner.

I — Invariants (safety)​

"Non-negotiable for inventory:

  1. Never sell below zero / never double-reserve the last unit under concurrency.
  2. During partition, minority must not commit stock changes (PC).
  3. Deduct API staleness = 0 — no 'eventually consistent stock' for checkout.
  4. Document PACELC per API, not one label for 'the database.'
  5. Catalog lag must not drive authoritative reserve."

C — Constraints (second C)​

ConstraintDesign response
WAN write latency (EC)Accept for deduct; cache catalog elsewhere
Spanner cost / lock-inHybrid; or self-hosted CRDB with eyes open
Cassandra team skillPrefer Spanner for stock; don't stretch CL alone
Flash salesShard hot SKUs; rate limit; pre-allocate pools
Multi-item cartTransaction scope / saga with stock service as source of truth

E — Evolution (prove the choice)​

Phased delivery:

PhaseDeliverable
M1ADR: stock = PC/EC; catalog = PA/EL
M2Spanner (or equiv) stock schema + deduct API
M3Cassandra/Dynamo catalog; async qty hints only
M4SLOs: p99 deduct latency; oversell = 0; lag for catalog
M5Chaos: regional partition — minority cannot sell

Failure modes:

FailureMitigation
Cassandra ONE on deductOversell — forbid on critical path
Spanner region lossMinority unavailable (PC)—UX fail closed
Using catalog qty to chargeAlways re-check stock service
"We're AP so we're fine"Wrong axis for inventory

Observability: oversell_count (must be 0), deduct p99, Spanner commit latency, catalog replication lag, partition error rate.


Closing line (interview)​

"So on PACELC: Cassandra defaults PA/EL—great for catalog, dangerous for stock unless you fight the defaults. Spanner is PC/EC—pays WAN latency every healthy day, fails closed on minority partitions, fits inventory. I'd put deduct on Spanner (or PC/EC shard) and browse on Cassandra, measure p99, and chaos-test that a partitioned region cannot oversell."

Scoring signals​

StrongWeak / red flag
Separates PAC and ELC"Spanner is CA / Cassandra is AP"
Oversell as safety invariant"AP is faster so Cassandra"
Spanner PC/EC vs Cassandra PA/ELNo partition story
Hybrid stock vs catalogOne DB for everything without reason
Tunable CL caveatsAssumes Cassandra QUORUM = Spanner
Latency budget for ECIgnores daily WAN cost

Compact outline (if time-boxed to 2 minutes)​

"PACELC both axes. Inventory needs PC on partition and EC when healthy—no oversell. Spanner = PC/EC (TrueTime, sync). Cassandra default = PA/EL (LOCAL_ONE); QUORUM helps but not Spanner-equivalent. Use Spanner for stock deduct; Cassandra for catalog. Measure p99 commit; chaos partition."

24. Weak Answer Example​

Question: "Compare Cassandra and Spanner for a global inventory system."

"Spanner is CA and Cassandra is AP. AP is faster so use Cassandra for inventory unless you need consistency."

Why weak / red flags: CA label; conflates CAP with PACELC; "AP is faster" without ELC; no partition behavior; no overselling risk; no consistency levels.

25. Hands-On Exercise​

Lab: ELC under load, then PAC

  1. Deploy PostgreSQL primary + async replica (or Cassandra with ONE vs QUORUM).
  2. ELC: Write on primary; read from replica immediately; measure how often reads are stale under load.
  3. ELC: Switch to quorum or primary reads; compare p99 latency (your numbers, not textbook fiction).
  4. PAC: Partition primary from replica; observe whether reads still succeed and what value they return.
  5. Document: Map results to PA/EL vs PC/EC quadrants.

Success criteria: Table of consistency level vs observed staleness and latency from your environment.

26. Knowledge Check​

  1. What does the E in PACELC stand for?
  2. How does ELC differ from CAP?
  3. Name a PC/EC system and why it qualifies.
  4. Why can EL normal operation worsen partition incidents?
  5. What PostgreSQL setting moves you from EL toward EC?
  6. Is PACELC a formal impossibility theorem?
  7. Give an example of hybrid PACELC in one product.
  8. What metric indicates EL risk without partition?
  9. How does Abadi's framework relate to Gilbert & Lynch?
  10. When is PA/EC a realistic configuration?
  11. How does replication lag relate to ELC without any partition?
  12. Active-passive async: PC/EL or PC/EC? (PC/EL — fast writes, stale replica reads.)
  13. What PACELC posture does global Spanner active-active use? (PC/EC normal and partition.)
  14. Why is "DNS failover" insufficient for ELC? (Target region may be EL-stale by RPO.)

27. Flashcards​

FrontBack
PACELCIf P → A vs C; Else → L vs C (Abadi 2012)
PAC branchSame tradeoff as CAP during partition
ELC branchLatency vs consistency when network healthy
PA/ELExample: Dynamo-style; serve fast; diverge on partition
PC/ECExample: Spanner; quorum; minority down on partition
ELAsync repl, local reads, lower coordination
ECSync/quorum; stronger guarantees; higher latency
PACELC vs CAPPACELC adds normal-case L vs C
Hybrid architectureDifferent PACELC per service or API
Replication lagKey EL operational metric
Consistency levelTunable ELC knob in Cassandra/MongoDB
RPOMax EL lag at failure — consistency bound after DR
Active-passive asyncPC/EL — EC writes local, EL replica reads
Active-active defaultPA/EL — local fast writes; merge on heal
PACELC formal statusDesign lens; not same as G&L proof

28. Cheat Sheet​

PACELC
If Partition → A vs C (CAP)
Else → L vs C (everyday tradeoff)

QUADRANTS (Abadi examples)
PA/EL Dynamo, Cassandra (default lean)
PC/EC Spanner, etcd
PC/EL strong leader + async reads
PA/EC rare; EC breaks under partition

ARCHITECT
per-API matrix, not one label
measure lag (EL) and quorum (EC)
chaos test PAC separately from load test ELC

HA/DR
Async DR → PC/EL normal; RPO = EL lag
Sync DR → PC/EC; RPO ≈ 0; WAN latency daily
Active-active → PA/EL default; Spanner = PC/EC
Failover → brief PC; promotion shifts ELC role

NOT
invented latency ms; not a replacement for formal consistency defs

30. References​

Primary sources​

  • Abadi, D. (2012). Consistency Tradeoffs in Modern Distributed Database System Design. IEEE Computer. [PACELC formulation]
  • Gilbert, S., & Lynch, N. A. (2002). Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services. ACM SIGACT News. [CAP — PAC branch foundation]
  • Herlihy, M. P., & Wing, A. V. (1990). Linearizability. ACM TOPLAS. [Strong consistency reference]

Implementation-oriented​

  • DeCandia, G., et al. (2007). Dynamo. SOSP. [PA/EL archetype]
  • Corbett, J., et al. (2012). Spanner. OSDI. [PC/EC archetype]
  • Kleppmann, M. (2017). Designing Data-Intensive Applications. O'Reilly. [Replication and consistency tradeoffs]

Critique and synthesis​

  • Abadi, D. (2010–2012). Blog posts on Hazelcast / DBMS Musings clarifying PACELC vs CAP triangle. [Practical framing]
  • Martin, K. (2012). Notes on CAP and PACELC. [Engineering-oriented summary]

Distinction​

  • Formal guarantees — Gilbert & Lynch apply to PAC (partition); linearizability definitions from Herlihy & Wing.
  • PACELC — Abadi's design framework for ELC; not a single unified impossibility theorem.
  • Implementation choices — Per-product consistency levels and replication modes; verify in official docs.
  • Operational experience — Lag and partition drills; measure in your environment rather than citing generic benchmarks.