PlanetScale

Database Sharding

Jan 9, 2025Ben Dicken
Database Sharding
SummaryAI, from the source post

This post introduces the fundamental concepts of database sharding as a solution for scaling databases to handle massive datasets and high query loads. It explains the architecture of sharded databases, including the role of proxy servers (VTGates) and the challenges of server overloading and proxy capacity. The post details two primary sharding strategies: range sharding, illustrating its drawbacks with examples of hot shards and uneven data distribution, and hash sharding, emphasizing its effectiveness in distributing data evenly, especially when using high-cardinality shard keys like user_id. It also briefly mentions other strategies like lookup sharding and custom functions supported by Vitess, and introduces the concept of cross-shard queries.

More from the Neki Query Performance trail