Level 1 · Apprentice0 XP
When one database transaction cannot cover the whole job: safe retries and locks across machines.
Step 1 / 6
ProblemA phone sends 'pay 40 euros'. The payment succeeds, but the answer is lost on a weak network. The app times out and sends the same request again. The customer is charged twice.
← → step
Before this: Choosing data stores for a system
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Add an idempotency key to one POST endpoint: a table with the key and the stored response, claimed with INSERT … ON CONFLICT DO NOTHING. Send the same request twice with the same key and check that the second call returns the first answer and does no new work.