frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Idempotency Is Easy Until the Second Request Is Different

https://blog.dochia.dev/blog/idempotency/
30•ludovicianul•2d ago

Comments

stavros•45m ago
Half of the mentioned issues are issues of atomicity, not idempotency. If I make a request, and the server crashes midway and doesn't send some crucial events, that's an issue whether or not I send a second request.

From a cursory read, only the part up to "what if the second request comes while the first is running" is an idempotency problem, in which case all subsequent responses need to wait until the first one is generated.

Everything else is an atomicity issue, which is fine, let's just call it what it is.

zinkem•35m ago
Idempotency is easy if you don't use mutable state in your middleware.

Auth, logging, and atomicity are all isolated concerns that should not affect the domain specific user contract with your API.

How you handle unique keys is going to vary by domain and tolerance-- and its probably not going to be the same in every table.

It's important to design a database schema that can work independently of your middleware layer.

shiandow•28m ago
This seems to assume retrying a command should result in the same response, but I am not sure I agree.

Idempotency is about state, not communication. Send the same payment twice and one of them should respond "payment already exists".

cocoto•15m ago
In your example, idempotency means same request + same state = same response. State becomes part of the request, that’s why it is hard.
shiandow•8m ago
That's just deterministic behaviour.

For idempotency you literally just want f(state) = f(f(state)). Whether you achieve this by just doing the same thing twice (no external effects) or doing the thing exactly once (if you do have side effects) is not important.

But if you have side effects and need something to happen exactly once it seems a lot more useful to communicate this, rather than pretending you did the thing.

chaz6•22m ago
You keep the hash of the request so that you can reject a subsequent request with a different body. This has helped me surface bugs and data issues in other systems.
mmillin•9m ago
This is an excellent article, I’ve seen almost all of the issues it calls out in production for various APIs. I’ll be saving this to share with my team.

I’ve seen two separate engineers implement a “generic idempotent operation” library which used separate transactions to store the idempotency details without realizing the issues it had. That was in an organization of less than 100 engineers less than 5 years apart.

One other thing I would augment this with is Antithesis’ Definite vs Indefinite error definition (https://antithesis.com/docs/resources/reliability_glossary/#...). It helps to classify your failures in this way when considering replay behavior.

Bun's experimental Rust rewrite hits 99.8% test compatibility on Linux x64 glibc

https://twitter.com/jarredsumner/status/2053047748191232310
566•heldrida•1d ago•531 comments

The One Dollar Counterfeiter

https://www.amusingplanet.com/2026/05/emerich-juettner-one-dollar.html
127•cainxinth•2d ago•39 comments

Show HN: Building a web server in assembly to give my life (a lack of) meaning

https://github.com/imtomt/ymawky
288•imtomt•7h ago•131 comments

Idempotency Is Easy Until the Second Request Is Different

https://blog.dochia.dev/blog/idempotency/
32•ludovicianul•2d ago•7 comments

Gemini API File Search is now multimodal

https://blog.google/innovation-and-ai/technology/developers-tools/expanded-gemini-api-file-search...
96•gmays•6h ago•13 comments

We see something that works, and then we understand it

https://lemire.me/blog/2025/12/04/we-see-something-that-works-and-then-we-understand-it/
98•surprisetalk•3d ago•32 comments

Casio S100X Japanese Lacquer Edition (JP Page Only)

https://www.casio.com/jp/basic-calculators/premium/en-s100x-jc1-u/
138•dr_kiszonka•2d ago•53 comments

Internet Archive Switzerland

https://blog.archive.org/2026/05/06/internet-archive-switzerland-expanding-a-global-mission-to-pr...
612•hggh•22h ago•99 comments

Rotten Dot Com

https://www.theparisreview.org/blog/2026/05/06/rotten-dot-com/
63•lordgrenville•1h ago•55 comments

LLMorphism: When humans come to see themselves as language models

https://arxiv.org/abs/2605.05419
8•okey•1h ago•0 comments

I’ve banned query strings

https://chrismorgan.info/no-query-strings
416•susam•17h ago•222 comments

Debian must ship reproducible packages

https://lists.debian.org/debian-devel-announce/2026/05/msg00001.html
150•robalni•4h ago•41 comments

Zed Editor Theme-Builder

https://zed.dev/theme-builder
224•cuechan•16h ago•65 comments

Local privilege escalation via execve()

https://www.freebsd.org/security/advisories/FreeBSD-SA-26:13.exec.asc
152•Deeg9rie9usi•13h ago•79 comments

Show HN: I made a Clojure-like language in Go, boots in 7ms

https://github.com/nooga/let-go
173•marcingas•16h ago•47 comments

A recent experience with ChatGPT 5.5 Pro

https://gowers.wordpress.com/2026/05/08/a-recent-experience-with-chatgpt-5-5-pro/
634•_alternator_•1d ago•467 comments

I'm writing a history of Visual Basic, Chapter 1 is up

https://evilgeniuslabs.ca/blog/visual-basic-history-chapter-1-launch
110•speckx•3d ago•39 comments

Distributing Mac software is increasing my cortisol levels

https://blog.kronis.dev/blog/apple-is-increasing-my-cortisol-levels
298•LorenDB•19h ago•196 comments

LLMs corrupt your documents when you delegate

https://arxiv.org/abs/2604.15597
415•rbanffy•1d ago•164 comments

Making your own programming language is easier than you think (but also harder)

https://lisyarus.github.io/blog/posts/making-your-own-programming-language.html
99•ibobev•2d ago•51 comments

EU Parliamentary Research Service calls VPNs "a loophole that needs closing"

https://cyberinsider.com/eu-calls-vpns-a-loophole-that-needs-closing-in-age-verification-push/
563•muse900•1d ago•386 comments

Task Paralysis and AI

https://g5t.de/articles/20260510-task-paralysis-and-ai/index.html
10•MrGilbert•3h ago•1 comments

Show HN: Rust but Lisp

https://github.com/ThatXliner/rust-but-lisp
134•thatxliner•12h ago•67 comments

Scouting's Real Crisis Is Not Marketing. It Is Decades of Neglect.

https://www.untendedfire.org/2026/05/09/scoutings-real-crisis-is-not-marketing-it-is-decades-of-n...
15•AuthorizedCust•5h ago•13 comments

Cooking the Hashish Cookbook

https://cookingthehashishcookbook.com/
3•benbreen•2d ago•3 comments

The hypocrisy of cyberlibertarianism

https://matduggan.com/the-intolerable-hypocrisy-of-cyberlibertarianism/
339•ColinWright•20h ago•293 comments

Surfel-based global illumination on the web

https://juretriglav.si/surfel-based-global-illumination-on-the-web/
59•vmg12•15h ago•6 comments

The first microcomputer: The transfluxor-powered Arma Micro Computer from 1962

https://www.righto.com/2024/02/the-first-microcomputer-transfluxor.html
59•rsecora•3d ago•2 comments

Gen Z Resentment Toward AI Grows as Adoption Stagnates and Workplace Fears Mount

https://www.waltonfamilyfoundation.org/about-us/newsroom/gen-z-resentment-toward-ai-grows-as-adop...
16•mgh2•2h ago•1 comments

Sparse Cholesky Elimination Tree

https://www.reidatcheson.com/sparse/linear/cholesky/2026/04/09/etree.html
32•selimthegrim•8h ago•0 comments