Index

Module 02 · System DesignWhen the stalls must agree

Charged Twice (idempotency & exactly-once)

Charged Twice
Charged Twice · Open board

A customer at the chai stall pressed pay once and was charged twice, and nothing in the system was broken. This lesson is why that is guaranteed to happen to you, and what to build so it stops.

Before you start. The cut phone line (CAP, done properly) gave you the one fact everything here rests on: a network drops messages, and it drops them silently, so you have to retry. This lesson is the bill for that advice, because a retry means the work can happen a second time.

Continue reading with a plan

The first three lessons of every track are free. This lesson is included with a plan, which unlocks every lesson, board, video, lab and paper for one price.

View plans →Already a member? Sign in

Lab

The reply never arrived. Did the money move, and what should the client do?

Drag Percent of messages the network swallows to the right, then walk the three tabs and watch the charged total under The money.

Open Charged twice →

Related paper

Review System Design →

Saved in this browser, and to your account when you sign in.