idemkit: Open-Source Python Library to Make Retryable Operations Safe
A developer has released idemkit, an open-source Python library designed to handle idempotency correctly across HTTP requests, message queues, and function calls. The project was born from a real-world experience of duplicate payment charges that persisted despite standard idempotency-key implementations, exposing race conditions and crash-recovery flaws. The library's core mechanism uses an atomic claim, an expiring lease, and a fencing token to ensure a given operation runs exactly once even under concurrent or repeated execution. It supports multiple backends including Redis, Postgres, MongoDB, and DynamoDB, and integrates with FastAPI, Flask, and Django via middleware or a decorator. Released as v0.1 under the Apache-2.0 license, the library is available on GitHub and via pip, with the author noting it provides effectively-once guarantees rather than exactly-once, as the latter is impossible in distributed systems.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in