{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreib326vu3achzptzfheuc5vjwvnbmaxkv536yigrdd2nijspdsm6je",
    "uri": "at://did:plc:5sgu76a53rz3n6unbykmovqy/app.bsky.feed.post/3mlohafzsh3e2"
  },
  "description": "Redis Cluster is Redis's native sharding mode. A cluster of Redis nodes partitions the keyspace into 16,384 hash slots; each node owns a contiguous range of slots; clients learn which node owns which slot and route commands directly. Redis Cluster combines sharding with replication for horizontal scale and availability.\n\n\nKey concepts\n\n * Hash slots. Each key is hashed (CRC16 mod 16,384) to one of 16,384 slots. Each master node owns a slot range.\n * Masters and replicas. Every master typically h",
  "path": "/engineering-glossary/redis-cluster-sharding/",
  "publishedAt": "2026-05-12T18:46:45.000Z",
  "site": "https://sahilkapoor.com",
  "tags": [
    "Redis",
    "Sharding",
    "Replication",
    "Valkey",
    "In-memory Database",
    "Redis as Infrastructure: Caching, Coordination, and Scale"
  ],
  "textContent": "**Redis Cluster** is Redis's native sharding mode. A cluster of Redis nodes partitions the keyspace into 16,384 **hash slots** ; each node owns a contiguous range of slots; clients learn which node owns which slot and route commands directly. Redis Cluster combines sharding with replication for horizontal scale and availability.\n\n## Key concepts\n\n  * **Hash slots.** Each key is hashed (CRC16 mod 16,384) to one of 16,384 slots. Each master node owns a slot range.\n  * **Masters and replicas.** Every master typically has one or more replicas; replicas can be promoted on master failure.\n  * **Cluster bus.** Inter-node gossip protocol on a separate port for topology, failure detection, and slot migration.\n  * **Hash tags.** Curly braces in a key like `user:{42}:cart` force keys with the same tag onto the same slot, enabling multi-key operations.\n\n\n\n## What changes versus single-node Redis\n\n  * **Multi-key commands.** Restricted to keys on the same slot; use hash tags when needed.\n  * **Transactions.** MULTI/EXEC only operate on a single slot.\n  * **Scripting.** Lua scripts must access only keys on one slot per invocation.\n  * **Resharding.** Slots can be migrated online between nodes; clients see brief redirections during migration.\n\n\n\nšŸ”—\n\n**Related Terms**\nRedis, Sharding, Replication, Valkey, In-memory Database\n\nšŸ“–\n\n**Further Reading**\nRedis as Infrastructure: Caching, Coordination, and Scale",
  "title": "Redis Cluster",
  "updatedAt": "2026-05-13T19:10:51.900Z"
}