Why is Redis fast despite being single-threaded, and is Redis 6+ still single-threaded?
Short answer
Redis is fast because the data lives in RAM, its data structures are optimized, and one event loop (epoll) serves thousands of connections with no locks or context switches. Since Redis 6 socket I/O can be multi-threaded, but commands still run one by one on a single main thread.
3 points to say:
- A command takes microseconds, a network round trip 0.1–1 ms: the network is the bottleneck, and one instance easily reaches 100K+ ops/second.
- Each command is atomic, but a
GET→ compute in the app →SETsequence is not: useDECR, Lua orWATCH/MULTI. - One slow command blocks everyone (
KEYS *,DELon a big key): useUNLINKand lazy free.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.