← Back to list

CAP Theorem: Choosing Between Strong and Eventual Consistency

Modern apps don’t live on a single server anymore. Whether you’re booking a ride or streaming a show, you’re tapping into an array of…

Stanley Nguma · 2025-09-09 15:44 · 0 claps · 2.3 min read
#cap-theorem #distributed-systems #design-systems #strong-consistency #eventual-consistency
Open on Medium ↗
Wiki topics: PRD · Product Design 📐 · Mathematics 🎬 · Film & Television

CAP Theorem: Choosing Between Strong and Eventual Consistency

Modern apps don’t live on a single server anymore. Whether you’re booking a ride or streaming a show, you’re tapping into an array of services running across thousands of machines worldwide. This unlocks scale and resilience.

Sounds powerful, right? But here’s the catch: keeping all these systems in sync is brutally hard. Networks drop packets, messages get delayed, and servers fail, often silently and without warning. In such an unpredictable environment, keeping data consistent across all nodes becomes less of an engineering detail and more of a fundamental design challenge.

This is where the CAP theorem steps in. It doesn’t solve the problem, but it gives us a clear lens: in the face of inevitable network partitions, distributed systems can guarantee at most two of three things Consistency(C), Availability(A), and Partition tolerance (P). Understanding this trade-off is not optional; it’s the foundation of how we design, operate, and reason about modern distributed systems.

What the CAP Theorem Says

CAP theorem tells us that in the presence of a network partition (when systems can’t talk to each other): You can only guarantee Consistency (C) or Availability (A), but not both at the same time.

In simpler terms:

  • Consistency = all users see the same data at the same time.
  • Availability = the system keeps responding even if some nodes are not available.
  • Partition Tolerance = the system keeps running despite network failures (non-negotiable in real life).

So every distributed system ends up choosing between CP (Consistency + Partition tolerance) or AP (Availability + Partition tolerance) when partitions occur.

Take a case of a ride-hailing system such a Uber. The design often comes down to a trade-off between strong consistency, where every trip request and driver assignment is immediately accurate across the system, and eventual consistency, where updates like driver availability or ETA changes may lag slightly but the system remains highly available and responsive.

Strong Consistency

This means once something is confirmed, every part of the system reflects it instantly. It ensures critical operations (like who’s picking you up) are never wrong.

📌 Example: When you’re assigned a driver, that pairing has to lock in everywhere immediately. On your app, the driver’s app, and the backend dispatch system. If two riders got assigned the same driver, there would be chaos.

Strong consistency favors accuracy over availability. If the system can’t guarantee the right match (say, during a server outage), it would rather block requests than risk double-booking.

Eventual Consistency

Eventual consistency takes a looser stance: updates may not be visible everywhere right away, but given time (and no further changes), everything converges. It keeps the app responsive, even if some updates lag behind.

📌 Example: You rate your driver 5 stars. That rating updates instantly in your app, but your driver’s profile might still show their old average for a few minutes. Eventually, after replication, their profile reflects your rating.

The system will accept this trade-off in areas like: Surge pricing updates, Rider/driver ratings and Map animations showing nearby cars.

Such design decisions are also applied in other systems such as banking, where strong consistency ensures account balances are always correct, while eventual consistency allows notifications, statements, and loyalty points to update without delaying core transactions.

Final Thought

The CAP theorem reminds us that you can’t have it all when system fail. Whether you’re booking a ride or checking your bank balance, the CAP theorem is at work behind the scenes. Systems succeed when they enforce accuracy where it matters and embrace eventual consistency where speed and availability win.


메타데이터
post_id
786196d25eb3
slug
cap-theorem-when-strong-vs-eventual-consistency-matters-786196d25eb3
url
https://medium.com/@stanleynguma/cap-theorem-when-strong-vs-eventual-consistency-matters-786196d25eb3
canonical_url
https://medium.com/@stanleynguma/cap-theorem-when-strong-vs-eventual-consistency-matters-786196d25eb3
author_url
https://medium.com/@stanleynguma
status
ok
fetched_at
2026-06-24 13:29:15