Comment

Comment by Solitude042

In the context of REST, idempotency is about duplicate requests not causing the system state to change further after the first request. For example, a POST might create a new resource each time, whereas a PUT would replace an existing resource. The POST changes the system with each call & created resource (not idempotent), whereas PUT likely wouldn't change the resource if the same content was PUT repeatedly (idempotent).

Idempotency provides resilience against messages that might be repeated (e.g., at-least-once delivery).

Idempotent operations are also typically structured as absolute, not relative data.

For example, a bank might send a message "set balance to $100", not "subtract $10 from balance" - if the message is repeated, the correct result is still obtained.

parent Solitude042 3 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton