On this page

The problem these theorems solve

The CAP theorem, explained

The misconception about "pick two"

What's missing from CAP

The PACELC theorem

Mapping real databases onto PACELC

PA/EL systems (availability and low latency)

PC/EC systems (consistency in both cases)

PA/EC systems (availability during partitions, consistency otherwise)

A caveat on these labels

Linking CAP and PACELC to real decisions

Common misconceptions interviewers test for

How to use this in an interview

Follow-up questions to expect

Putting it all together

Keep learning

CAP Theorem vs PACELC: Understanding Distributed System Trade-offs

Image
Arslan Ahmad
The CAP theorem explained — and why PACELC is the better framework for modern distributed systems. With database examples, interview questions, and trade-off analysis.
Image

The problem these theorems solve

The CAP theorem, explained

The misconception about "pick two"

What's missing from CAP

The PACELC theorem

Mapping real databases onto PACELC

PA/EL systems (availability and low latency)

PC/EC systems (consistency in both cases)

PA/EC systems (availability during partitions, consistency otherwise)

A caveat on these labels

Linking CAP and PACELC to real decisions

Common misconceptions interviewers test for

How to use this in an interview

Follow-up questions to expect

Putting it all together

Keep learning

Every system design interview at some point hits the same three letters: CAP.

The interviewer asks something like "What consistency model does your database use?" or "What happens when the network between your two data centers fails?" — and suddenly you're supposed to explain the CAP theorem cleanly, without hand-waving.

Here's the tricky part: CAP is half of the story. The other half is PACELC — the less famous but more practical extension that captures what CAP leaves out. If you can explain both, you'll sound dramatically more senior than the candidate who just quotes "two out of three."

This guide walks through both frameworks the way a senior engineer thinks about them — not as academic theorems, but as decision tools you actually use when picking a database. By the end, you'll know:

  • What the CAP theorem really says (and the myths that get repeated in interviews)
  • Why "pick two out of three" is a misleading framing
  • What PACELC adds that CAP is missing
  • How to map real databases onto both frameworks
  • How to use this reasoning live in a system design interview

Let's go.

The problem these theorems solve

Before getting to the letters, understand the problem.

When you run a database on a single machine, your life is simple. Writes are durable once they hit disk. Reads return whatever the latest write was. You don't think about consistency because there's only one copy of the truth.

The moment you replicate data across more than one machine — for availability, for geographic distribution, for read scale — you inherit a hard problem. How do you keep all the copies in sync? And what happens when the network between those copies fails?

In distributed systems, different failures are inevitable: servers crash, disks fail, network links break. The network especially is the villain here — it's the one failure you can't engineer your way out of. Two data centers will, eventually, briefly lose the ability to talk to each other. This is called a network partition.

CAP and PACELC are frameworks that describe the unavoidable trade-offs a distributed database makes in the face of these realities.

The CAP theorem, explained

The CAP theorem was formalized by Eric Brewer in 2000 (and later proven by Gilbert and Lynch in 2002). It states that a distributed data store cannot simultaneously provide all three of the following guarantees:

Consistency (C): Every read receives the most recent write, or an error. All nodes see the same data at the same time. This is equivalent to having a single up-to-date copy of the data, even though the system may have many physical replicas.

Availability (A): Every request received by a non-failing node returns a response — any response, even if it might be stale. The system stays responsive. It never says "I can't answer right now."

Partition tolerance (P): The system continues to operate even when the network between nodes fails and messages are dropped or delayed. Data is replicated enough that the system survives any partition that doesn't take out every node.

The theorem says you can have any two of these three, but not all three at once.

Let me show you why with a tiny thought experiment. Imagine you have two database nodes, A and B, both storing a user's bank balance. They sync by replicating writes to each other over the network.

Now the network between A and B fails. A customer hits node A and writes "balance = $100." Before that write can replicate, another customer hits node B and reads the balance.

Node B has two choices:

  1. Return the old balance (from before the failed replication). The system stays available, but it's not consistent — A says 100, B says 0.
  2. Refuse to respond (because it can't verify it has the latest data). The system stays consistent, but it's not available — the customer gets an error.

There's no third option. Once the network breaks, you have to pick.

CAP Theorem
CAP Theorem

The misconception about "pick two"

Most explanations of CAP stop at "pick two out of three." This framing is actively misleading, and interviewers know it.

Here's why: partition tolerance is not optional. You can't "choose to not have partitions" any more than you can choose to not have earthquakes. Partitions happen whether you plan for them or not. If you build a distributed system and don't design for partition tolerance, you haven't built a distributed system — you've built a fragile single-node system that happens to be deployed across multiple machines.

So in practice, the real CAP trade-off is much narrower:

When a partition happens, do you choose consistency or availability?

That's the whole theorem, phrased honestly. You're not picking two of three. You're picking one of two, and only in the moment a partition occurs.

Systems that pick consistency under partition are called CP systems. They refuse to serve requests from nodes that can't verify they have up-to-date data. You get correctness, but you might get errors during network issues.

Systems that pick availability under partition are called AP systems. They keep serving requests even when nodes are out of sync, accepting that different clients might see different values temporarily. You get uptime, but you get stale reads.

If an interviewer asks "is your system CP or AP?" and you answer "it depends on the partition, but we chose CP here because we can't afford to show inconsistent account balances" — you've given a better answer than 90% of candidates.

What's missing from CAP

CAP tells you what happens during a partition. That's useful — but partitions are rare events. Most of the time, your distributed system is running in the normal case, with the network working fine.

What trade-offs does a distributed system make in the normal case?

CAP is silent on this. And that silence matters, because the normal-case trade-offs are the ones that affect your users every single day, not just during a once-a-month network blip.

Here's the trade-off CAP ignores: even with no partition, a distributed system that replicates data across multiple nodes has a choice between latency and consistency.

If you want strong consistency — every read sees the latest write — you need to wait for writes to replicate to all relevant nodes before acknowledging them. That's slow. It adds latency to every write.

If you're willing to accept eventual consistency — reads might briefly see stale data — you can acknowledge writes as soon as they hit one node and let replication happen in the background. That's fast. But for a brief window, different clients can see different values.

This trade-off applies 99% of the time. CAP doesn't capture it. That's what PACELC was invented to fix.

The PACELC theorem

PACELC was introduced by Daniel Abadi in 2010 as an extension to CAP. The name itself encodes the full framework:

If there is a Partition (P), the system must trade off between Availability (A) and Consistency (C) — just like CAP says.

Else (E), when the system is running normally, it must trade off between Latency (L) and Consistency (C).

Read it out loud: "P-A-C / E-L-C." Two trade-offs, two situations.

The breakthrough in PACELC is the ELC half. It captures a trade-off senior engineers make constantly but CAP never acknowledges. Every time you configure a database's replication setting — "acknowledge on one replica" vs "acknowledge on majority" vs "acknowledge on all" — you're making an ELC choice.

PACELC gives you a four-letter classification for any distributed database:

  • PA/EL — Chooses availability during partitions, and lower latency otherwise. Maximum responsiveness, weakest consistency.
  • PA/EC — Chooses availability during partitions, but prioritizes consistency in the normal case. A common "best of both worlds" position.
  • PC/EL — Chooses consistency during partitions, but optimizes for latency otherwise. Rare in practice.
  • PC/EC — Chooses consistency in both cases. Maximum correctness, but you pay in latency and availability.

Most real databases fall into PA/EL, PA/EC, or PC/EC. PC/EL exists mostly in theory.

PACELC Theorem
PACELC Theorem

Mapping real databases onto PACELC

This is the part that shows up most often in interviews. You should be able to place the major distributed databases on the PACELC spectrum.

PA/EL systems (availability and low latency)

Cassandra, Amazon DynamoDB, and Riak live here. They're the "high availability no matter what" family — originally designed for Amazon's shopping cart and Facebook's inbox, systems where taking a write matters more than being immediately consistent.

During a partition, these systems keep accepting writes on both sides, reconciling conflicts later. In the normal case, they acknowledge writes as soon as one replica has them, giving you single-digit millisecond latency.

These systems are your default choice when: availability is business-critical, writes should never fail, and your application can tolerate eventual consistency (a few hundred milliseconds of "seeing stale data" is fine). Think: social feeds, shopping carts, session storage, IoT telemetry. If you want to go deeper on NoSQL databases in this family, see NoSQL databases for system design.

PC/EC systems (consistency in both cases)

Google Bigtable, HBase, and Apache ZooKeeper live here. They're the "correctness above all" family — designed for use cases where stale or inconsistent data is worse than no data.

During a partition, these systems refuse to serve reads from nodes that can't verify they're up-to-date. In the normal case, they wait for writes to reach a quorum of replicas before acknowledging, which adds latency but guarantees that any read afterward sees the write.

These systems are your default when: correctness is non-negotiable, and your application can tolerate occasional unavailability. Think: distributed locks, service discovery, configuration storage, financial ledgers.

PA/EC systems (availability during partitions, consistency otherwise)

MongoDB (in its default configuration) lives here, as does CockroachDB in many configurations. These are the "have it both ways" systems that optimize for consistency in the normal case but let you keep serving writes when things go wrong.

MongoDB illustrates this nicely. It runs with a primary and secondaries. All writes go to the primary and replicate asynchronously to the secondaries. In the normal case, you get strong consistency if you read from the primary (EC). But during a network partition where the primary is isolated, MongoDB elects a new primary on the majority side and keeps taking writes — accepting that some unreplicated writes on the old primary will be lost (PA).

MongoDB also gives you knobs. You can configure write concern ("acknowledge on majority") and read concern ("read from majority") to move yourself toward PC/EC — at the cost of latency. Most distributed databases give you these knobs now; the default configuration tells you where the designers think most applications should live.

A caveat on these labels

These classifications aren't permanent. Most modern databases let you tune consistency per-query. DynamoDB can do strongly consistent reads (at 2x the cost). Cassandra lets you set consistency level per operation. Even MongoDB's PACELC classification changes based on which replica set config you use.

So when you say "Cassandra is PA/EL" in an interview, a sharp interviewer might follow up with "can I configure it to behave differently?" The correct answer is "yes — you can dial up consistency with tunable consistency levels, but that's a trade-off against latency and throughput." This is the deep version of the senior answer.

Linking CAP and PACELC to real decisions

Here's how this framework shows up in actual system design choices.

"Should I use strong or eventual consistency for my social media news feed?"

This is an ELC question. The data is replicated; there's no partition (usually). Do you want a write (a new post from someone you follow) to immediately appear on every follower's feed (EC — strong, slow), or is it okay if it appears within a few hundred milliseconds (EL — eventual, fast)?

For a social feed, EL is the obvious choice. A 200ms delay between posting and appearance is invisible to users, and the latency improvement is massive. This is why feeds use AP/EL systems like Cassandra.

"What happens if my checkout service can't reach the inventory database?"

This is a PAC question. There's a partition (or at least a failed connection). Do you keep accepting orders optimistically (PA — might oversell) or block checkout until the partition heals (PC — might lose sales)?

For most e-commerce, you want PC here — overselling is worse than losing a sale. But some businesses (like flash sale sites) choose PA and reconcile inventory later, eating the occasional oversell as a cost of doing business.

"Should I use DynamoDB or Spanner for my core transactional data?"

DynamoDB is PA/EL; Spanner is PC/EC (leveraging Google's TrueTime to achieve strong consistency globally). The answer depends on whether your transactions need external consistency across regions (Spanner) or whether eventual consistency with tunable strong-read options is enough (DynamoDB). If you want to deep-dive on picking between databases like these, see PostgreSQL vs MongoDB vs DynamoDB.

Notice that in none of these examples do I start with the letters. I start with the business decision and use the framework to make the trade-off explicit.

Common misconceptions interviewers test for

A few things interviewers specifically want to catch:

"CA systems exist." No, not really. Any single-node database trivially provides C and A, but it's not a distributed system. Any actually distributed system has to handle partitions, which means the CA quadrant is effectively empty.

"Consistency in CAP is the same as ACID consistency." No. ACID's C means "transactions preserve database invariants." CAP's C means "all nodes agree on the value of a single piece of data." They share a name but mean different things. An interviewer who asks you to distinguish these is checking whether you've read past the first Wikipedia paragraph.

"PACELC is just CAP with extra letters." No. CAP and PACELC describe different trade-offs in different situations. You need both. CAP alone undersells how much of a distributed system's behavior happens in the normal (no-partition) case.

"The CAP theorem tells us which database to pick." No. CAP tells you what trade-off a database makes. The right database for your application depends on what your application can tolerate — which is a business question, not a CAP question.

How to use this in an interview

If an interviewer asks about CAP or consistency, here's the structure of a senior answer:

  1. Name the specific trade-off, not the letters. "For this use case, I need to decide whether to accept stale reads during a network partition."
  2. Tie the trade-off to the business requirement. "The business can tolerate showing a like count that's a few seconds stale, but it cannot tolerate the feed refusing to load."
  3. Make the consistency choice explicit. "That tells me I want an AP system — availability over consistency during partitions."
  4. Name a specific database that fits. "I'd use Cassandra or DynamoDB for the feed store."
  5. Acknowledge the trade-off you just accepted. "This means I need to handle eventual consistency in the application layer — maybe a timestamp on each like to resolve conflicts."

That structure works for CAP and for PACELC. It sounds like a senior engineer because it IS how senior engineers actually reason.

Follow-up questions to expect

Once you've introduced CAP or PACELC in an interview, follow-ups usually land on:

  • "What's the difference between strong consistency and linearizability?" (Linearizability is a specific, stronger form of consistency that includes real-time ordering. Not every "strongly consistent" system is linearizable.)
  • "How does Cassandra handle conflicts when two nodes accept writes to the same key during a partition?" (Last-write-wins with timestamps, or vector clocks in some configurations.)
  • "What is eventual consistency, and how long is 'eventual'?" (Usually milliseconds to seconds. Bounded by network speed and replication lag. See eventual vs strong consistency for the full picture.)
  • "Can a system be both CP and AP at different times?" (Yes — many modern systems let you configure per-query. DynamoDB's consistent read option is an example.)
  • "What's the relationship between CAP and the ACID/BASE distinction?" (ACID databases tend toward CP; BASE databases tend toward AP. But the correspondence isn't exact.)

If you can answer those five without stumbling, you've earned the "actually understands distributed systems" badge that the interviewer is issuing.

Putting it all together

Here's the takeaway in one sentence: CAP tells you what happens when the network breaks; PACELC tells you what trade-offs you're making every other day of the year.

Both frameworks are tools for making trade-offs visible. They don't pick the database for you — you pick the database based on your application's real requirements. But they give you a vocabulary to explain that choice to an interviewer, a colleague, or your future self six months from now when you're debugging a consistency issue at 2 AM.

The candidates who stop at "pick two out of three" sound junior. The candidates who say "let me walk through the PACELC trade-off for this specific use case" sound senior. The difference is a few sentences of framing, and now you have them.

Good luck with your interviews.

Keep learning

If you want to go deeper on the topics this post touched, here's where to go next:

For the full system design interview roadmap, start with my complete system design interview guide.

CAP Theorem
System Design Fundamentals
System Design Interview
Availability

What our users say

Matzuk

Algorithms can be daunting, but they're less so with the right guide. This course - https://www.designgurus.io/course/grokking-the-coding-interview, is a great starting point. It covers typical problems you might encounter in interviews.

KAUSHIK JONNADULA

Thanks for a great resource! You guys are a lifesaver. I struggled a lot in design interviews, and this course gave me an organized process to handle a design problem. Please keep adding more questions.

Steven Zhang

Just wanted to say thanks for your Grokking the system design interview resource (https://lnkd.in/g4Wii9r7) - it helped me immensely when I was interviewing from Tableau (very little system design exp) and helped me land 18 FAANG+ jobs!

More From Designgurus
Substack logo

Designgurus on Substack

Deep dives, systems design teardowns, and interview tactics delivered daily.

Read on Substack
Annual Subscription
Get instant access to all current and upcoming courses for one year.

Access to 50+ courses

New content added monthly

Certificate of completion

$29.08

/month

Billed Annually

Recommended Course
Grokking the System Design Interview

Grokking the System Design Interview

169,039+ students

4.7

Grokking the System Design Interview is a comprehensive course for system design interview. It provides a step-by-step guide to answering system design questions.

View Course
Join our Newsletter

Get the latest system design articles and interview tips delivered to your inbox.

Read More

System Design 101: A Beginner’s Guide to Key Concepts

Arslan Ahmad

Arslan Ahmad

I Wished I Knew These Data Replication Strategies Before the System Design Interview

Arslan Ahmad

Arslan Ahmad

Top System Design Interview FAQs – Key Answers Explained

Arslan Ahmad

Arslan Ahmad

Mastering the Meta Technical Screen: A Comprehensive Guide for Senior Software Engineers

Arslan Ahmad

Arslan Ahmad

Image
One-Stop Portal For Tech Interviews.
Copyright © 2026 Design Gurus, LLC. All rights reserved.