John Hugg presented at Boston Data Ignite on Jan. 28, 2016. These slides cover the Two Generals Problem, with an interesting analogy between ninjas, Jean-Claude Van Damme and distributed systems!
2. Why?
• Distributed systems touch everyone’s lives
at some point or another.
• People ask, why can’t stuff just work?
• Answer: Distributed Systems are hard.
• Two Generals Problem is a fun problem I
can maybe describe in 5 minutes.
3. Set the Scene
• To make things confusing, we’re
going to explain this problem with
ninjas instead of generals.
The most important thing to
know is that ninjas need to
attack all at once!
12. Any other plans?
• There are not a lot of other options
given the limited rules of this game.
• Sending messengers at the same
time doesn’t really change anything.
(for example)
13. Just Gonna Say It
• It’s mathemagically impossible for the ninja
armies to agree to a time with 100%
certainty.
• This is called:
“The Two Generals Problem”
E. A. Akkoyunlu, K. Ekanadham, and R. V. Huber in 1975
14. Just Gonna Say It
• It’s mathemagically impossible for the ninja
armies to agree to a time with 100%
certainty.
• This is called:
“The Two Generals Problem”
E. A. Akkoyunlu, K. Ekanadham, and R. V. Huber in 1975
15. IT’S A METAPHOR
• The ninjas are really computer
programs.
• The forest is an unreliable computer
network.
17. Networks will let you down
• Sooner or later,
Jean-Claude Van
Damme will come for
your network traffic.
• Once you accept that
networks are terrible,
you can start building
software that is robust.
18. Further Thoughts
• If you have 3 armies of ninjas (or 3
computer programs) you can do more
things. 3 is way better.
• You can, in fact, agree to attack at
10:05pm.
• But… there’s no guarantee you can
agree before 10:05pm has come and
gone.
19. Real World Example
• Message delivery – what do you do
when processes and/or networks fail
and delivery state is unknown?
– At least once delivery?
– At most once delivery?
20. Real World Example
• Message delivery – what do you do
when processes and/or networks fail
and delivery state is unknown?
– At least once delivery?
– At most once delivery?
• Turns out exactly once is hard for
reasons related to ninja armies.