Перейти к содержимому

Consistent Hashing Explained: Why Sharding Breaks When You Add a Server (System Design Interview)

Repeat By Design

0:00 / 0:00

Consistent Hashing Explained: Why Sharding Breaks When You Add a Server (System Design Interview)

281 просмотр · 1 мес. назад
Repeat By Design
32 подписчика
281 просмотр · 1 мес. назад
Consistent hashing is what stops your database from falling apart every time you add a server. In this video I break down exactly why mod hashing fails at scale, and how a virtual ring fixes it — with the same diagrams I'd draw in a real system design interview. This is Part 2(Final) of the database scaling series. Watch Part 1 first →    • Why Your Database Isn't Scaling (And How t...   ⏱️ Chapters 00:00 Intro 00:17 Why sharding breaks down 00:52 What is hashing? (hash function and fixed-length output) 03:02 The problem with mod hashing 08:07 Consistent hashing explained 08:51 How the virtual ring works 10:03 Adding a new server — the 1/n rule 12:13 The uneven distribution problem 12:50 Virtual servers: the fix 13:49 Conclusion 📌 What you'll learn Why sharding has a ceiling, and where it breaks Hash function basics: arbitrary input, fixed-length output Mod hashing and the rehashing problem — why 1 million keys get moved How consistent hashing shifts only ~1/n of your keys Virtual servers, and how they fix uneven load distribution Covers: consistent hashing, consistent hashing system design, hashing in system design, database sharding, database scaling, distributed systems and system design interview prep. Built for SDE interview prep, and backend engineers working through system design rounds. 🔗 Connect Instagram: @repeat.by.design Website: repeatbydesign.com