అన్ని traffic ను ఒక key కి funnel చేయడం ఆపండి: hot key ను N sub-keys గా split చేయండి (sharded counters), duplicate reads ను coalesce చేయండి, ఒక local cache నుండి serve చేయండి, మరియు writes ను batch చేయండి తద్వారా ప్రతి request పై ఒక row update అవ్వదు. ఒక viral post పై ఒక్క "likes" counter 50k writes/sec తీసుకోవచ్చు — ప్రతి transaction అదే lock కోసం పోరాడుతుండగా ఒక row ఒక serialization bottleneck అవుతుంది.
ఒక contended row కి బదులు fan-out
50k inc/sec on post:123
│
hash(request) % N (split the key)
┌────────┬────────┬────────┬────────┐
▼ ▼ ▼ ▼ ▼
likes:123:0 :123:1 :123:2 :123:3 :123:4 ← sharded counters
└────────┴───┬────┴────────┴────────┘
▼
SUM on read = total (read fans in)
