DELAPARRA
Index
Color
NL
Category: Core glossary

Idempotent

Explained by Updated

What is Idempotent?

Idempotent: An operation that produces the same result regardless of how many times it is executed. HTTP PUT and DELETE should be idempotent; POST is typically not. An idempotent operation gives the same result no matter how many times you run it. Setting a value to 5 is idempotent; adding 5 is not.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about Idempotent

How is Idempotent used in practice?

This matters because things get retried. A network timeout, a queue job that runs twice, a user double-clicking a button. If the operation is idempotent, a retry is harmless. If not, you might charge a customer twice or send the same email three times.

What should you keep in mind with Idempotent?

In HTTP, GET, PUT and DELETE are meant to be idempotent, while POST usually is not. For payments and other important POST requests, an idempotency key helps: the client sends a unique ID, and the server ignores repeats. Design background jobs, webhooks and deploy scripts to be safe to run twice. It is one of the cheapest forms of reliability.

At a glance

CategoryCore glossary
Explained by
Updated

More Core glossary terms

All terms starting with I

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.