Idempotency
A customer presses Pay. The request times out on their train's patchy signal, so the app retries, and the card is charged twice. Retries are everywhere in async systems, from clients, load balancers, queues and workers. Idempotency is what makes them safe.
In this lesson you'll learn to
- Define idempotency and tell naturally idempotent operations from ones that aren't.
- Design idempotency keys for an API, including what to store and how to answer a repeat.
- Handle two copies of the same request arriving at once, and a repeat with different parameters.
- Make message consumers idempotent with conditional updates, upserts, version checks and deduplication.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.