0Pricing
Caching Strategies: Redis + CDN + Edge Computing · Lesson

Redis Cluster and Sharding

Learn how Redis Cluster scales a cache horizontally across many nodes using hash slots, how keys are routed, and how to keep related keys together with hash tags.

Why Scale Beyond One Node?

A single Redis instance is limited by one server's memory and throughput. Redis Cluster spreads data across many nodes so the cache can grow far beyond a single machine.

Hash Slots

Redis Cluster divides the keyspace into 16384 hash slots. Each node owns a range of slots. A key belongs to exactly one slot, determined by hashing the key.

TOTAL_SLOTS = 16384

def slot_for(crc):
    return crc % TOTAL_SLOTS

print('Slot:', slot_for(123456789))

All lessons in this course

  1. Redis Persistence & HA
  2. Distributed Caching with Redis
  3. Redis Pub/Sub for Invalidation
  4. Redis Cluster and Sharding
← Back to Caching Strategies: Redis + CDN + Edge Computing