Cap Theorem medium
Why is Two-Phase Commit (2PC) considered a 'CP' (Consistent) protocol?
- A It utilizes a non-blocking gossip protocol to ensure 100% service availability even during a total region outage.
- B The protocol requires every single node in the cluster to unanimously agree before a transaction can be committed.
- C Participants can continue to process new transactions independently even if the central coordinator becomes unreachable.
- D The protocol can block indefinitely if any single node or the coordinator fails, prioritizing Atomicity over system Availability.
Answer: D. The protocol can block indefinitely if any single node or the coordinator fails, prioritizing Atomicity over system Availability.
Two-Phase Commit (2PC) is a classic 'CP' approach to distributed transactions. During the commit phase, all participating nodes must be reachable and agree to commit. If a network partition occurs or a node crashes, the entire transaction must wait or be aborted to prevent data inconsistency. This 'blocking' nature ensures correct data (Consistency), but at the clear cost of being unable to serve requests (Availability) during faults.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- What is a 'Split Brain' scenario?
- The PACELC theorem extends CAP by stating: Even when there is NO partition (E), the system must choose between:
- Why is a CA (Consistent + Available) system generally considered impossible for distributed web applications?
- In CAP, 'Consistency' is equivalent to:
- In the CAP Theorem, what does the 'P' stand for?
- What causes a Network Partition?