ScouterWhy

Home · Tech in 60 Seconds

Sharding in 60 Seconds — How to Split a Billion Users

· 52s

Watch on YouTube

AI Images and video in this clip are AI-generated and are not real footage. Facts were checked against the sources below before publishing.

Transcript

  1. Can one database handle a billion users?
  2. Not easily. So you split the data across many databases. That's sharding, like library branches.
  3. One: the shard key. Like an author's last name, every book has one.
  4. Two: how to split. Range groups A to H. Hash spreads them evenly.
  5. Three: finding it. A router reads the key and sends you to the right branch.
  6. What if one branch gets slammed? Just build another?
  7. That's a hotspot. Go from three branches to four with simple hashing, and 75% of the books move.
  8. So we use consistent hashing. Put branches on a ring, and only about a quarter moves.
  9. Sharding splits the data. Replication copies it. In practice, you use both.
  10. Splitting is easy. Re-splitting is hard.
  11. Recap: shard key, range or hash, router.
  12. Changing a shard key means moving all your data. So pick it from your most common queries.

Sources

  1. Microsoft Learn, Azure Architecture Center, "Sharding pattern" (2026-04-02)
  2. MongoDB Manual, "Sharding" (확인 2026-10-27)
  3. MongoDB Manual, "Shard Keys" (확인 2026-10-27)
  4. MongoDB Manual, "Ranged Sharding" (확인 2026-10-27)
  5. MongoDB Manual, "Hashed Sharding" (확인 2026-10-27)
  6. Vitess Docs, "VTGate" (확인 2026-10-27)
  7. Apache Cassandra Documentation, "Dynamo" (architecture, 확인 2026-10-27)
  8. MongoDB Manual, "Replication" (확인 2026-10-27)
t