The Two Generals’ Problem

  • Published on:  8/12/2019
  • Time to tell a story about idempotency, computer science, and the Night of the Multiple Orders. • Sponsored by Dashlane —try 30 days for free at: BASICS: by Sean M Elliott and Tom ScottDirected by TomekGraphics by Mooviemakers mix by Haerther Productions to Dashlane for sponsoring the video! If you're techie enough to watch this video, you should be using a password manager. Get a 30-day free trial at'm at https://tomscott.comon Twitter at Facebook at on Instagram as tomscottgo


  • Tom Scott
    Tom Scott  28 days ago+2628

    Yes, I had help with the graphics for this series. There's no way I'd have animated that myself! On that note, thanks to Dashlane for sponsoring and helping me hire an animator: their free trial link is

  • Kinetik07
    Kinetik07 7 days ago+3683

    So it's like double posting by accident?

  • WMTeWu
    WMTeWu 7 days ago+672

    There are only two hard problems in distributed systems: 2. Exactly-once delivery 1.Guaranteed order of messages 2. Exactly-once delivery
    ~ Mathias Verraes

  • Putin did nothing wrong.
    Putin did nothing wrong. 7 days ago+315

    See you all in 2023 when this video gets recommended again

  • z beeblebrox
    z beeblebrox 7 days ago+205

    idempotency: when you're able to have children, but just the one time.

  • MarbleSwan666
    MarbleSwan666 7 days ago+98

    I find the idea of two armies going one by one through a valley sending acknowledgments back and forth until everyone is dead hilarious
    Just imagine the army in the castle being confused.

  • Kinetik07
    Kinetik07 7 days ago+3661

    So it's like double posting by accident?

  • Brian Certain
    Brian Certain 7 days ago+208

    1:24 Spelled out "Tom" with the semaphore flags! ( ͡° ͜ʖ ͡°)

  • Dominykas Turčinavičius

    "A single human error is never the root cause"
    A single human error: I'm about to end this man's whole career

  • Philip Melchert
    Philip Melchert 7 days ago+227

    Everyone else: Goes to bed a reasonable time
    Me: Stays up all night trying to solve the unsolvable general problem with 0 knowledge of computer science

  • Magic Morgan
    Magic Morgan 3 days ago+7

    The fact you spent £1,795 inc vat per minute of this videos graphics is beyond me

  • Romi
    Romi 7 days ago+5253

    Oi nothing wrong with ordering the exact same things 5 times in a row I have my reasons

  • Voodoomancer
    Voodoomancer 7 days ago+128

    Moral of the story: If you want to be a programmer, learn to cook.

  • Ikis DragonFist
    Ikis DragonFist 7 days ago+88

    -"So what are we having? Chinese? Mexican?"

  • Maldus Alver
    Maldus Alver 7 days ago+49

    "Would you like to pay again?"
    Sounds like everything is working as intended to me.

  • Anders Hwang
    Anders Hwang 7 days ago+37

    Science: impossible
    Engineering: shoot a message over

  • P2M
    P2M 7 days ago+2992

    "A single human error is never the root cause"
    You underestimate my power.

  • Derpyyy
    Derpyyy 7 days ago+27

    One evening in late 2018, our neighbours came over and gave us free pizza saying they received more than they ordered, but we never knew why or what happened. Funny that this video seems to have solved that mystery haha

  • EEVblog
    EEVblog 7 days ago+48

    I'm surprised there is no mention about Byzantine Faults (a.k.a the Byzantine generals problem), and there are solutions that claim to be "Byzantine compliant" or "Byzantine fault tolerant", and this is a big thing in the cryptocurrency space right now.

  • jammin023
    jammin023 2 days ago+1

    I wish these videos had been around back when I was doing Soft Eng at uni... your explanations are so much clearer than my lecturers could manage!