Cap Theorem
CAP theorem: Consistency, Availability, Partition tolerance.
CAP Theorem states that a distributed system can guarantee only two out of the following three properties at the same time: Consistency (C) Availability (A) Partition Tolerance (P)
Node 1 Node 2 Consistency. 100 90 balance(incorrect) Availability. X 100. balance(system down)
Partition tolerance :
Network break
Note:When a network partition occurs, a system must choose between Consistency or Availability.
| # | System / Use Case | CAP Choice | Why This Choice Is Important | | -- | ----------------------------------------------- | ---------- | ---------------------------------------------------------------------------------- | | 1 | Banking system | **CP** | Financial data must always be correct; system may reject requests during partition | | 2 | Stock trading platform | **CP** | Incorrect price or trade execution can cause huge financial loss | | 3 | Distributed databases (strong consistency mode) | **CP** | Data integrity across nodes is critical | | 4 | Airline reservation system | **CP** | Prevents double seat booking | | 5 | Configuration management system | **CP** | All services must read the same configuration | | 6 | Social media feed | **AP** | Slightly stale posts are acceptable if the platform remains available | | 7 | DNS system | **AP** | DNS must always respond even if records are slightly outdated | | 8 | Online shopping cart | **AP** | Cart must remain accessible even during replication delays | | 9 | Messaging systems | **AP** | System should continue delivering messages even during temporary failures | | 10 | News / content websites | **AP** | Serving slightly outdated content is acceptable | | 11 | Single-server SQL database | **CA** | No distributed network; system can maintain both consistency and availability |
we will stop the systwm
social media