logoalt Hacker News

raffael_detoday at 11:02 AM3 repliesview on HN

Idempotency means f(x) = f(f(x)).*

Here x is interpreted as state and f an action acting on the state.

State is in practice always subjected to side effects and concurrency. That's why if x is state then f can never be purely idempotent and the term has to be interpreted in a hand-wavy fashion which leads to confusions regarding attempts to handle that mismatch which again leads to rather meandering and confusing and way too long blog posts as the one we are seeing here.

*: I wonder how you can write such a lengthy text and not once even mention this. If you want to understand idempotency in a meaningful way then you have to reduce the scenario to a mathematical function. If you don't then you are left with a fuzzy concept and there isn't much point about philosophizing over just accepting how something is practically implemented; like this idempotency-key.


Replies

toolslivetoday at 11:34 AM

> *

I wondered about this too. Also, why was it framed in the context of JSON based RPC over HTTP ?

Hendriktotoday at 11:31 AM

> That's why if x is state then f can never be purely idempotent

That is simply not true. f could be, for example, “set x.variable to 7”, which is definitely idempotent.

show 1 reply