Skip to content
Glossary

What is idempotency?

Networks retry. Users double-click. Payment providers resend. Idempotency is why none of that charges anyone twice.

Plutonapps Engineering1 min read

In short

Idempotency is the property of an operation that has the same effect whether it runs once or many times. In an app, it means a retry, a double click or a redelivered webhook cannot charge a card or send an email twice. It is usually enforced with an idempotency key the server remembers.

Also called: Idempotent operation, Idempotency key

Why it matters when your prototype goes to production

In a demo every request succeeds the first time. In production, requests time out halfway, phones lose signal, and providers resend events they are not sure you received. Anything that moves money or sends a message has to assume it will be asked twice.

How an idempotency key works

The client attaches a unique key to the request. The server records the key with the result the first time, and on any repeat returns that result instead of acting again. Stripe's API works this way for all POST requests.

What it looks like in practice

  • Bell writes every outgoing email to a ledger under one permanent key, so retries, second tabs and redelivered jobs land on the same row, and each email is sent exactly once.
  • Ekko gives each payout one permanent name, and passes the same name to the payment provider, which refuses a duplicate.

Common questions

Is idempotency the same as deduplication?

Related, not the same. Deduplication drops repeated messages; idempotency makes repeating an operation harmless, whether or not the repeat is detected as a duplicate.

More on this: Production architecture & security · All glossary terms

Built something in Lovable you want people to rely on?

We are the engineers who take it the rest of the way — secured, tested, released and supported.