How We Handle Millions of Transactions Without Downtime

The Flash Sale Problem
Imagine 50,000 users clicking "Buy Now" within the same 10-second window. Every request expects instant confirmation. Any overselling means refunds, angry customers, and lost trust. This is the reality of running Karcis ID during major event launches, and it forced us to rethink everything about our transaction pipeline.
The Architecture That Survived
Our stack evolved through painful lessons. The current system uses Go services behind an API gateway, with Redis handling all real-time inventory operations. The critical insight was separating the reservation flow from the payment flow:
- Reservation - Atomic decrement via Redis Lua scripts, sub-10ms per operation
- Payment queue - FIFO processing with dead letter queues for failed payments
- Confirmation - Async write to
PostgreSQLwith idempotency keys
We stopped trying to make the database handle concurrency and moved the critical path entirely into Redis. Database writes happen asynchronously after the seat is already locked.
Zero Downtime Deployments
Downtime during a sale is not an option. We run blue-green deployments with health check gates. New versions warm up in the background, and traffic shifts only after the new instance confirms it can handle load. Rolling back is a single command that flips the load balancer target. We practice this weekly, not just during incidents.
Observability as a Feature
Every transaction generates traces through OpenTelemetry. We built custom dashboards that show real-time inventory levels, queue depth, payment success rates, and p99 latency. During flash sales, the entire engineering team watches these dashboards. We have caught and fixed issues within seconds because someone noticed a latency spike before users did.
What I Would Do Differently
If I rebuilt this today, I would invest in load testing infrastructure earlier. Our first flash sale exposed race conditions that unit tests never caught. Now we run simulated flash sales every month with production-like traffic patterns. The boring preparation is what makes the exciting moments uneventful - and in infrastructure, uneventful is the highest compliment.


