Idempotency
medium 26 minAn idempotent operation has the same effect whether it runs once or many times.
Where it shows up
The same pattern appears across everyday software.
Card payments
Stripe accepts an Idempotency-Key and returns the saved answer for a repeated key, and an error if the parameters differ.
Ride booking
A phone in a lift sends the request again when it gets signal. One ride must come, so the app keeps the request id.
Bank transfers
Each transfer carries a reference. A second file with the same reference is refused instead of paid again.
Configuration tools
Kubernetes and Terraform are told the wanted state. Applying the same file twice changes nothing the second time.
Message consumers
Standard queues may deliver a message more than once, so consumers record ids or write with upserts.
Data pipelines
A failed nightly job is run again. Replacing the partition of that day gives the same result; appending would count everything twice.