Idempotency Patterns

•
69
•

Implements robust idempotency and deduplication patterns for APIs and distributed systems to ensure exactly-once execution.

This skill provides production-ready patterns for building reliable distributed systems where operations can be safely retried without side effects. It includes deterministic key generation logic, FastAPI middleware for request deduplication using Redis, database-backed idempotency for financial transactions, and event consumer patterns to handle at-least-once delivery semantics. It is essential for backend developers building payment systems, webhook handlers, and high-reliability microservices where data integrity and consistency are paramount.

主な機能

0169 GitHub stars
02Database-backed persistence patterns using SQLAlchemy and PostgreSQL
03FastAPI middleware for automatic header-based request deduplication
04Exactly-once event processing logic for message queue consumers
05Distributed lock strategies to prevent race conditions during concurrent retries
06Deterministic idempotency key generation for consistent request tracking

ユースケース

01Ensuring safe mutation operations (POST, PUT, DELETE) in RESTful backend services
02Handling retries in webhook listeners and message queue consumers without side effects
03Preventing duplicate charges or refunds in financial and payment processing APIs