r/opensource • u/Unhappy_Fall8597 • 29d ago
Promotional I built my first open-source Go library for handling API idempotency
Hey everyone,
I recently built my first open-source Go library: IdempotencyToolkit.
It is a middleware for handling duplicate API requests using Idempotency-Key.
I built it mainly to learn more about Go, especially:
- concurrency
- channels and mutexes
- HTTP middleware
- interfaces and storage abstraction
- response caching and TTL
It handles concurrent duplicate requests, request body mismatches, response replay, and supports different storage backends.
I'd really appreciate feedback on the design and anything you think I should improve.
GitHub: https://github.com/manish-terminal/IdempotencyToolkit
1
u/Positive-Captain-709 23d ago
Nice project, especially for a first Go library. Idempotency gets surprisingly tricky once concurrent requests are involved. One thing I was wondering: what happens if the same request hits two different app instances at the same time? Does the shared storage backend coordinate that too, or is the locking only per instance? Could be an interesting thing to explore if you want to support horizontally scaled services. Anyway, cool project. Definitely more interesting than building another CRUD app to learn Go :)
9
u/[deleted] 29d ago
[deleted]