Free tech learning for everyone, from basics to pro

Distributed SystemsSystems ArchitectureIntermediate

The CAP theorem and PACELC

In short: The CAP theorem says that when a network partition splits a distributed system, it must choose between consistency and availability. PACELC extends this: even without a partition, there is a trade-off between latency and consistency.

The three letters

  • Consistency (C): every read sees the most recent write, as if there were one copy of the data. This is the strong form called linearisability.
  • Availability (A): every request to a working node gets a non-error response, without waiting forever.
  • Partition tolerance (P): the system keeps operating even when messages between nodes are lost, so the cluster is split into groups that cannot talk.

The theorem, proposed by Eric Brewer and later proved formally, is often stated as "pick two of three". That slogan is misleading.

What CAP really says

CAP during a partitionNetwork partitionnodes cannot talkChoose Crefuse or block requestsChoose Aanswer, maybe stale
Figure 1. When the network splits, a system must either stay consistent or stay available.

In any system spread over a network, partitions will happen: a switch fails, a link is cut, or a cloud zone is isolated. You cannot opt out of P. So the real choice is what to do during a partition:

  • CP: keep consistency. Nodes that cannot confirm they have the latest data refuse writes or reads, returning errors or timing out. Banking ledgers and configuration stores such as etcd behave this way.
  • AP: keep availability. Every node keeps answering, even if its data might be stale, and the groups reconcile later. Shopping baskets, social feeds and DNS lean this way.

When there is no partition, a well-built system can offer both C and A. CAP only describes the behaviour under failure.

PACELC: the everyday trade-off

PACELC choicesPC/ECconsistent alwaysPA/ELavailable, fastPC/ELmixedPA/ECmixed, rarerIf partitionA or CElselatency or C
Figure 2. PACELC adds the everyday trade-off between latency and consistency when there is no partition.

Daniel Abadi pointed out that partitions are rare, but a trade-off exists all the time. PACELC reads: if there is a Partition, choose A or C; else, choose Latency or Consistency.

Keeping replicas strongly consistent means waiting for other nodes to confirm each write, which adds delay, especially across regions. Letting a write complete locally and copying it later is faster but allows stale reads.

ClassBehaviourTypical fit
PC/ECConsistent in failure and in normal runningFinancial records, coordination services
PA/ELAvailable in failure, low latency normallySession stores, product catalogues, caches
PC/EL or tunableConsistency level chosen per requestMany modern databases with quorum settings

Many databases let you choose per query, for example by setting how many replicas must acknowledge a read or write. This makes the trade-off a design decision for each piece of data rather than a fixed product label.

Applying it at work

  1. List the data your service stores and ask what harm a stale read would cause.
  2. For money, stock counts and permissions, prefer consistency and accept errors during partitions.
  3. For likes, recommendations and caches, prefer availability and low latency.
  4. Document what users see during a partition, and test it (see chaos testing).

Tip: if an exam asks you to "pick two", explain that P is not optional in a real network, so the choice is C or A during a partition.

A common mistake is calling a single-node database "CA". A single node avoids partitions only because it is not distributed; it also has no redundancy if that node fails.

Practice

Why is "pick any two of C, A and P" misleading?
Partitions happen in any real network, so P is not optional. The true choice is between C and A while a partition lasts.
A payments service returns errors when it cannot reach a majority of replicas. Is it CP or AP?
CP: it gives up availability to avoid inconsistent data.
What does the "ELC" part of PACELC describe?
Else (no partition), there is still a trade-off between latency and consistency, because synchronous replication adds delay.

Key takeaways

  • CAP: during a partition, choose consistency or availability.
  • Partition tolerance is not optional in real networks.
  • PACELC adds the normal-time trade-off between latency and consistency.
  • Many databases let you tune consistency per request.
  • Choose per type of data, based on the harm of stale reads.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.