Distributed-Transactions

1 post in this section

Design a Digital Wallet

Move $1 from wallet A to wallet B. A million times a second.

That’s the whole problem, and it is the best-structured chapter in this series — because rather than presenting one architecture, it walks through four, each one solving what the previous one broke:

  1. In-memory sharding — fast, and loses money when a node crashes
  2. Distributed transactions — correct, and you can’t explain why a balance is what it is
  3. Event sourcing — auditable, and too slow going over the network
  4. Distributed event sourcing — fast, reliable, and shardable

Watching a design fail four times is more instructive than seeing the final answer, so that’s how this is written.

Continue reading »