KB: Redis
Redis is single-threaded (per-shard) Single threaded nature of RedisRedis uses a mostly single threaded design. This means that a single process serves all the client requests, using a technique called multiplexing. This means that Redis can serve a single request in every given moment, so all the requests are served sequentially.This approach helps Redis maintain consistency and avoid race conditions, even in concurrent and multi-client environments How data is sharded in Redis: Redis Cluster does not use consistent hashing, but a different form of sharding where every key is conceptually part of what we call a hash slot. There are 16384 hash slots in Redis Cluster, and to compute the hash slot for a given key, we simply take the CRC16 of the key modulo 16384 Sharding: - Question:- What’s the solution to fix the Split-Brain situation ? - Answer:- Maintain an odd number of primary shards and two replicas per primary shard. Here is the detailed solution to this problem To prevent s...