Mental note about an important concept, a number is idempotent if such a number by multiplying itself successive times gives itself, that is the formal, mathematical explanation. By now, an idempotent operation should be treated like numbers. Basically, we need this numbers to identify an event in a distributed system.

Applied to message brokers, an idempotent operation is one that if you perform it many times, would have the same effect as if you performed it only once. This is how in message brokers, we manage to deliver and process a message only once, exactly once delivery (kafka 0.11.X branch).

Applied to REST, (it really is to HTTP verbs) it tells us that, the repeated execution of a request with the same parameters on the same resource will have the same effect on the state of our resource in the system if it is executed 1 or N times.

Through REST, first we would have to create a request through POST, once the server returns you a 200 and the header returns the identifier created, you can make PUT on that identifier so that all operations are idempotent.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s