The CAP theorem needed an update. The CAP You can only achieve two...

The CAP
You can only achieve two out of the following three properties at any given time:
Consistency: All nodes have the same data view.
Availability: Every request receives a non-error response.
Partition tolerance: The system can function even when network partitions occur.
Based on this definition, a database is available even if a query returns a response after 15 days.
That kind of latency is not acceptable for any real-world application.
The PACELC Theorem came to the rescue.
What happens during regular operation (when there is no partition)?
Systems have to choose between Latency and Consistency.
A real-world Example:
Let's say we have a real-time multiplayer online game with a global leaderboard.
The game has servers distributed worldwide and shows player scores and rankings.
Let's assume there's no partition.
Latency over Consistency (LC)
The system updates the closest server immediately when a player finishes a game.
This quick update offers low latency but takes time to reach other servers.
During this lag, players connecting to different servers may see outdated leaderboard information.
Consistency over Latency (CL)
When a player finishes a game, the system updates all servers before confirming the score.
This method ensures a globally consistent leaderboard but increases response time.
CAP is a good starting point, but PACELC provides a more complete framework.
Availability and Partition Tolerance (AP)
The American and European clusters independently update their local leaderboards.
Players in both regions can still see and update their scores, but the leaderboards will not align until the partition is resolved.
Consistency and Partition Tolerance (CP)
The game blocks leaderboard updates in American and European clusters until the network issue is resolved.
This provides a consistent global leaderboard but sacrifices availability during the partition.
CAP is a good starting point, but PACELC provides a more complete framework for understanding the complexities of distributed systems.
