DEV Community

Cover image for C.A.P - The 3 Friends That Can’t Stay Together
TANITOLUWA IFEGBESAN
TANITOLUWA IFEGBESAN

Posted on

C.A.P - The 3 Friends That Can’t Stay Together

When you hear the word CAP, what comes to mind?

A hat?
Someone “capping” (Gen Zs know what I mean 😂)?
Maybe even a fancy British brand?

Well… in tech, CAP means something completely different.

I’m talking about the CAP Theorem, also known as Brewer’s Theorem, one of the most important ideas behind how modern banking systems, fintech apps, and global platforms handle data.

And trust me, once you understand it, you’ll never look at apps the same way again.

Imagine This…

You transfer money from your banking app.
Your balance updates on your phone instantly.
But your friend sitting beside you logs into the same account from another device… and still sees the old balance (a very common issue in some banking apps 🤫).

Now imagine this happening in a financial institution.
Panic. Calls. Complaints. Audits. Headlines.
This is exactly the kind of problem the CAP Theorem tries to solve.

So, What Is CAP?
CAP stands for:
Consistency
Availability
Partition Tolerance

In distributed systems (systems (or nodes) running across multiple servers or locations), you can only fully guarantee two out of these three at the same time.

It’s like trying to keep three best friends happy during an argument , eventually, one gets ignored , where I usually stand.

The Three Players

1. Consistency (C)
Everyone sees the same data at the same time.

If ₦500,000 leaves your account, every ATM, mobile app, branch portal, and dashboard should immediately reflect that exact balance.

No confusion. No delays.

Think of it like a synchronized choir, everyone sings the same note together.

2. Availability (A)
The system always responds.

Even during heavy traffic or partial failures, the app still works.

Maybe you’ve noticed this before:

  • WhatsApp still sends messages during poor internet
  • Instagram still loads older posts when the network struggles

That’s availability in action.

In banking, this means customers can still access services even when parts of the infrastructure are struggling.

3. Partition Tolerance (P)
This is the ability of a system to survive network failures.

Servers disconnect. Networks fail. Data centers lose communication.

And in global systems, this is not a “maybe.” It’s guaranteed to happen.

A bank may have servers in Lagos, London, and New York. If Lagos temporarily loses connection to London, the system must still continue operating.

That survival ability is Partition Tolerance.

Here’s the Catch…
In distributed systems, network failures are unavoidable.

So Partition Tolerance is not optional.

That means the real choice becomes:

  • Do you prioritize Consistency?
  • Or do you prioritize Availability?

This creates two major system designs:

CP Systems
(Consistency + Partition Tolerance)
These systems prioritize correct and synchronized data.
If something goes wrong in the network, the system may temporarily refuse requests rather than risk showing incorrect information.

In simple terms:
“It’s better to delay than to lie.”
This is extremely important in financial systems
where accuracy matters more than speed.

Examples include:

  • MongoDB
  • TB db
  • Redis

AP Systems
(Availability + Partition Tolerance)
These systems prioritize staying online.

Even during network issues, the system continues responding , although some users might temporarily see older data.

Think of social media:
If likes update a few seconds late, nobody really minds.

But in banking?
That decision becomes much more sensitive.

Examples include:
Apache Cassandra
CouchDB

What About CA?
CA means:
Consistency
Availability

Sounds perfect, right?
The problem is: it doesn’t survive network failures.
And in real-world distributed systems, failures always happen eventually.

So true, CA systems mainly exist in:

  • Single-server systems
  • Small local systems
  • Non-distributed environments

Why Financial Institutions Care About CAP
This isn’t just theory.

Every financial institution makes CAP decisions daily:

  • Should ATM transactions prioritize consistency?
  • Should mobile banking remain available during outages?
  • Should transfers wait for confirmation from every node?
  • In the event of a network failure, how can duplicate transactions be avoided?

These decisions directly affect:

  • customer trust,
  • transaction integrity,
  • fraud prevention,
  • uptime,
  • and regulatory compliance.

A delayed transaction can frustrate users.
An inconsistent transaction can destroy trust.
That’s the balancing act.

The Biggest Misunderstanding About CAP
Many people think CAP means:
“Choose any two.”
Not exactly.

The theorem really says:

  • During a network partition, you must choose between consistency and availability.
  • And because partitions are inevitable, architects must design systems intentionally based on business priorities.

Final Thought
The most fascinating thing about distributed systems is that engineering is often less about building “perfect” systems…

…and more about deciding which compromise is safest.

For social media, slight inconsistency may be acceptable.

For healthcare, aviation, or banking systems?
Accuracy can be worth more than speed.

And that’s why understanding CAP isn’t just for software engineers - it’s foundational knowledge for anyone building reliable financial technology at scale.

Top comments (0)