Suggest an editImprove this articleRefine the answer for “What makes Redis a single-threaded system?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Redis is considered single-threaded because all client command processing happens in one main thread - a deliberate architectural choice, not a limitation: every operation runs sequentially, so there are no locks, mutexes, or context switches. **Key point:** starting with version 6.0, Redis does use extra helper threads for I/O (AOF compression, RDB saves, replication) and network I/O, but the actual command logic (GET, SET, INCR, etc.) still runs in a single main thread.Shown above the full answer for quick recall.Answer (EN)ImageRedis is considered a **single-threaded system**, because **all client command processing happens in one main thread**. This is a deliberate architectural choice, not a limitation. ### What this means in practice Redis runs **a single thread** that: - reads commands from clients, - processes them, - sends back responses. Every operation happens **sequentially**, one after another, so Redis **uses no locks, mutexes, or context switches**. ### Why this makes Redis fast 1. **No resource contention.** Since every command runs sequentially, there are no "data races" or memory-access conflicts. 2. **No thread-synchronization overhead.** Multi-threaded systems need to coordinate access to shared data (mutexes, locks, semaphores). Redis avoids this entirely. 3. **Operations are atomic.** Each command runs to completion before the next one starts. That simplifies the guarantees around data integrity. 4. **Minimal context switching.** One thread, one context. There's no constant "jumping" between tasks, unlike in multi-threaded applications. ### But Redis isn't "always one thread" Modern versions of Redis (starting with 6.0) do use **extra helper threads**: - for **I/O operations** (AOF compression, RDB saves, replication); - for **network I/O** when there are a lot of clients; - for **asynchronous tasks** that don't affect the main command-processing loop. However, **Redis's command logic** (GET, SET, INCR, etc.) still runs **in a single main thread**. **Summary:** Redis is single-threaded because **every command is processed sequentially in one main thread**, which rules out locking and makes it as fast and predictable as possible. Extra threads are used only for background operations, without disturbing the main loop.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.