Why I didn't reach for Redis: payment idempotency with PostgreSQL row locks
Classly processes payments through two gateways. Here's how I used SELECT FOR UPDATE SKIP LOCKED and advisory locks to get idempotency without adding a lock service.
Selected notes
Long-form notes on distributed systems, Linux internals, and the infrastructure behind production software.
Classly processes payments through two gateways. Here's how I used SELECT FOR UPDATE SKIP LOCKED and advisory locks to get idempotency without adding a lock service.