System design

Expert

Capstone: payments across regions

Design from scratch the payment API of a European wallet: 8,000 balance reads and 1,000 payments per second at peak, 99.95 % availability, no payment ever lost, and a push notification for every payment. At 16:00 Paris goes down for two hours, and at 17:00 a database node crashes while Paris is still down. Budget: 25,000 dollars a month.

Users are in Paris; Frankfurt is 9 ms away. A payment may be accepted first and settled a few seconds later. The push provider answers in about 120 ms, accepts 5,000 calls per second and fails now and then; each notification must arrive exactly once.

What your design must achieve

  • Availability ≥ 99.95 %
  • Latency p99 < 300 ms
  • Duplicated side effects = 0
  • Background jobs that failed = 0
  • Lost writes = 0
  • Monthly bill < 25,000 $

What you will master