Natural idempotence requires deep understanding of the domain, which developers (and coding agents) do not always have. Also, it's still a limited solution, which doesn't solve the generic case. So it's each much easier to use technical idempotency solutions like:
- stamp every initial request / domain event with the UUID (idempotency key)
- use client-side IDs instead of using server-generated ones with RETURNING
- use PUT instead of POST
- use UPSERTs
- etc.
IMO, you migh as well use CQRS/ES which is a natural evolution of this idea of modeling the physical reality rather than trying to reduce it to CRUD/L
Here, we can draw an analogy between natural hedging and financial hedging (derivatives). Natural hedging requires planning, preparation, and hard work, and even that doesn't cover every scenario, but it's cheap. With derivatives, you pay someone else to take care of it. The other party may not even understand the underlying asset, but they have quant models (a technical solution)
RE: the question about the first mentions of idempotency keys, IMO cryptographic nonces (numbers used only once) are somewhat related. Idempotency keys are used to facilitate message replay, while nonces are used to prevent replay. But the basic idea is similar
- stamp every initial request / domain event with the UUID (idempotency key)
- use client-side IDs instead of using server-generated ones with RETURNING
- use PUT instead of POST
- use UPSERTs
- etc.
IMO, you migh as well use CQRS/ES which is a natural evolution of this idea of modeling the physical reality rather than trying to reduce it to CRUD/L
Here, we can draw an analogy between natural hedging and financial hedging (derivatives). Natural hedging requires planning, preparation, and hard work, and even that doesn't cover every scenario, but it's cheap. With derivatives, you pay someone else to take care of it. The other party may not even understand the underlying asset, but they have quant models (a technical solution)
RE: the question about the first mentions of idempotency keys, IMO cryptographic nonces (numbers used only once) are somewhat related. Idempotency keys are used to facilitate message replay, while nonces are used to prevent replay. But the basic idea is similar