6 ms·
"Idempotency keys", sheesh. Just use standard terminology: these are just futures/promises.
by naasking 9y ago
"Idempotency keys", sheesh. Just use standard terminology: these are just futures/promises.
- pbreit 9y agoFutures/promises means nothing to me. But I always thought an idempotency key was just sending in a time stamp or something else unique.
- naasking 9y agoTime stamps are not unique, you definitely need something unique, like a GUID to distinguish it from such tokens bound to other client requests. And you'd be better served learning about the more general abstraction rather than learning a single domain-specific trick. This solution is obvious once you know about promises.
- dboreham 9y agoWait...what? I'm all for "standard terminology" but they're for sure just not the same thing. At all.
- naasking 9y agoSure they are. The idempotency key is simply a representation of a promise. The E language and the Waterken server implement promise semantics exactly like this: bind the results of a local or remote computation to a durable representation, and that representation is used to store the result upon completion. All future requests return the that stored result, ie. idempotency. In case of network partition where the client doesn't receive a reply, it can safely and simply retry the operation on the promise, which returns the stored result. The E language popularized futures/promises, and it's still the gold standard.
- saltcured 9y agoI think you are arguing a very niche perspective here. The concept of idempotence in mathematics predates futures/promises by about a century and is part of the general background understood by most people exposed to any CS concepts. It has been prevalent across a wide range of communities discussing networking protocol and message-passing designs since the inception of the Internet. It appears in countless RFCs and other standards documents which are read by people building web-based systems. The concept of futures/promises you are promoting is honestly a niche part of computer science from the 1970s which persists in an intersection of distributed systems research and programming language research. It was never the prevalent formalism shared by general CS or network engineering communities. Meanwhile, a different aspect of the same 1970s concept has had a rebirth as an asynchronous programming syntax and appears in widely consumed languages. This different camp of PL researchers has essentially won the popularity contest which defines the new "standard" meaning of futures and promises for the general technical audience.
- naasking 9y agoI'm not arguing against idempotency, or attempting to redefine it, I'm pointing out that "idempotent key" as used in this article precisely denotes a future. You might as well write an article on a "text-based client/server GET/PUT/POST protocol" without labelling it HTTP. It's stupid and unnecessarily obfuscated. This abstraction has a well-known technical name, so use it, don't invent a new term. And I frankly find it bizarre that you call futures/promises "niche" when they're now part of every web browser in the world and millions of programmers use them every day. The fact that these futures aren't durable isn't relevant since the browser environment itself is transient.