CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/System Design Interview Classics

πŸ“ System Design Interview Classics Β· Network

Distributed Cache with Consistent Hashing

How a distributed cache spreads keys across nodes with consistent hashing, so adding or removing a node moves only a small share of keys.

More System Design Interview Classics templates

Drawing diagram…

What this diagram shows

  • Keys map to positions on a hash ring
  • Each node owns several virtual positions for even load
  • Each key is copied to the next node for availability

Prompt used

Network view of a distributed cache: application servers use a client library that hashes each key onto a ring. Four cache nodes each own several virtual points on the ring. A key is stored on the first node clockwise and replicated to the next node. A configuration service tracks the ring and tells clients when nodes join or leave.

Mermaid code
flowchart LR
  A1[App Server 1] --- LIB1[Cache Client Library]
  A2[App Server 2] --- LIB2[Cache Client Library]
  subgraph RING[Hash Ring]
    N1[Cache Node A - vnodes 1,5,9]
    N2[Cache Node B - vnodes 2,6,10]
    N3[Cache Node C - vnodes 3,7,11]
    N4[Cache Node D - vnodes 4,8,12]
  end
  LIB1 --- N1
  LIB1 --- N2
  LIB2 --- N3
  LIB2 --- N4
  N1 -.replica.- N2
  N2 -.replica.- N3
  N3 -.replica.- N4
  N4 -.replica.- N1
  CFG[Config Service] --- LIB1
  CFG --- LIB2
  CFG --- RING

Related templates

C4 ArchitectureProSystem Design Interview Classics

URL Shortener System Design

The classic interview design for a service like bit.ly: short code generation, fast redirects from a cache, and click analytics processed separately.

SequenceSystem Design Interview Classics

Chat App Message Delivery (WhatsApp-style)

How a one-to-one chat message is delivered in a WhatsApp-style system, with sent, delivered and read ticks, and push notifications when the receiver is offline.

Data FlowSystem Design Interview Classics

Social News Feed (Twitter-style)

How posts reach followers' feeds: fan-out on write for normal users, fan-out on read for celebrities, and a ranked feed built from a cache.

C4 ArchitectureProSystem Design Interview Classics

Ride Matching System (Uber-style)

The core of a ride-hailing app: drivers stream their locations, a geo index finds nearby drivers, and a matching service offers the trip to the best one.

FlowchartSystem Design Interview Classics

API Rate Limiter (Token Bucket)

How a token bucket rate limiter decides whether to let an API request through, using Redis so all servers share the same counts.

DeploymentProSystem Design Interview Classics

Notification Service Design

A notification system that sends email, SMS and push messages at scale: one API, a queue per channel, user preferences, and retries.