Two Generals' Problem
Understand the two generals problem as a fundamental challenge in distributed systems where achieving consensus between two endpoints is impossible over an unreliable, asynchronous network. Learn how this thought experiment relates to messaging and acknowledgment failures in distributed databases, illustrating why consensus is difficult in such environments.
The two generals’ problem is a thought experiment to demonstrate the problem of consensus in a distributed environment. The thought experiment shows that it is impossible to achieve consensus between two endpoints if communication is asynchronous and the underlying link is prone to failure.
Problem
Imagine two armies, Army A and Army B, led by two generals preparing to attack a fortified city. The armies station themselves on both sides of the fort in Valley A and Valley B. The attacks will ...