00 /What You Will Learn
By the end you will be able to
- Explain idempotency and the idempotency key header.
- Keep the key record and the charge in one transaction so a crash cannot split them.
- Return 409 for a request still running, 422 for a reused key with a different body, and replay the stored answer otherwise.
- Explain a lease, so a dead attempt does not block a payment forever.
- Say why Redis can only be a cache here, and why declines are stored too.
Before you start
Finish Lab 05 (SQL Transactions and Isolation) and Lab 07 (Redis and Lua Scripting) first. You should know a transaction and SET key value NX. Docker Desktop and Python 3 are needed.