Data & Consistency
Partition data across multiple databases to scale write throughput and storage
Split data into shards by hash, range, tenant, or geography. Route requests to the correct shard and rebalance online as data grows.
When a single database cannot handle write volume or dataset size, or you need tenant/geo isolation.
User/content stores and large multi-tenant datasets.
# Shard router sketch
shard = hash(user_id) % N
conn = pools[shard]
conn.query(...)
Timeline and user shards
Hundreds of millions of usersRange/hash sharding for media and users
Billions of media objectsContent and metadata sharded globally
Exabyte-scale datasetsHigh - Many shards in parallel
High - Routing and rebalancing
Medium to High - More nodes