Shopee Flash Sale Engine: Redis Lua & Overselling

Answer-first: Shopee prevents overselling during high-concurrency flash sales by combining local memory caching, Redis inventory sharding, and atomic Lua script decrements. This multi-tier architecture isolates hot keys in Redis memory shards and evaluates stock availability in sub-milliseconds without acquiring relational database locks. Chapter 2: Flash Sale Engine - The Mystery Behind Redis and Hot Keys ← Series hub | ← Prev | Next → Prerequisite: Read the previous article: Chapter 1: Microservices Foundation - The Power of Go, gRPC, and API Gateway. ...

May 5, 2026 · 8 min · Lê Tuấn Anh