π What is Partition Tolerance in CAP Theorem?
Partition Tolerance (P) means a distributed system continues to operate even if there is a network failure that blocks communication between parts (or "partitions") of the system.
π§© In Simple Terms:
If some nodes can't talk to each other, the system can still respond to requests, possibly with reduced consistency or availability.
π οΈ Real-World Example:
Imagine a distributed system with 3 nodes β A, B, and C. Now a network failure occurs between Node A and Nodes B & C.
- With Partition Tolerance, both partitions (A and B+C) keep running independently.
- The system must decide whether to:
- β Reject some requests to maintain Consistency (CP), or
- β Accept requests even if they might serve stale data (AP)
π‘ Partition Example in a Streaming App:
β οΈ Key Implications:
- Partitions are inevitable in real-world networks (due to latency, dropped packets, hardware failure).
- You cannot sacrifice partition tolerance in a truly distributed system β so in practice:
- You choose between Consistency (CP) and Availability (AP).
π§ Partition Tolerance = Resilience
- If a system is not partition-tolerant:
- It will crash or freeze during any network issue.
- If a system is partition-tolerant:
- It gracefully handles partitions without complete failure.