Challenge - 5 Problems
Two-Phase Commit Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
What is the main purpose of the two-phase commit protocol?
In a distributed system, what is the primary goal of using the two-phase commit protocol?
Attempts:
2 left
💡 Hint
Think about what atomicity means in transactions across multiple systems.
✗ Incorrect
Two-phase commit ensures that either all nodes commit a transaction or none do, preventing partial commits.
❓ Architecture
intermediate2:00remaining
Which component coordinates the two-phase commit process?
In a two-phase commit protocol, which component is responsible for coordinating the commit or abort decision among participants?
Attempts:
2 left
💡 Hint
Consider who sends the 'prepare' message in the protocol.
✗ Incorrect
The coordinator manages the transaction by asking participants if they can commit and then instructing them to commit or abort.
❓ scaling
advanced2:00remaining
Why does two-phase commit limit scalability in microservices?
Which of the following best explains why two-phase commit can reduce scalability in microservice architectures?
Attempts:
2 left
💡 Hint
Think about what happens when multiple services wait for each other.
✗ Incorrect
Two-phase commit forces all services to lock resources until the commit decision, causing blocking and reducing throughput.
❓ tradeoff
advanced2:00remaining
What is a major tradeoff when avoiding two-phase commit in distributed systems?
If a system avoids two-phase commit to improve performance, what is a common tradeoff it must accept?
Attempts:
2 left
💡 Hint
Consider what consistency guarantees are relaxed when not using two-phase commit.
✗ Incorrect
Avoiding two-phase commit often means systems accept eventual consistency to gain better performance and availability.
❓ estimation
expert3:00remaining
Estimate the impact of two-phase commit on transaction latency
Assume a distributed transaction involves 5 microservices communicating over a network with an average round-trip time of 50ms. Using two-phase commit, estimate the minimum additional latency introduced by the protocol before the transaction commits.
Attempts:
2 left
💡 Hint
Remember two-phase commit requires a prepare phase and a commit phase with message exchanges.
✗ Incorrect
Two-phase commit involves at least two rounds of communication (prepare and commit) with all participants, adding multiple network delays.