You now understand database scaling.
Horizontal partitioning (sharding) splits rows across databases.
Strategies: Hash-based (even distribution), Range-based (hotspot risk), Geographic (low latency).
Consistent hashing minimizes data movement when adding/removing shards.
Hotspots happen. Mitigate with composite keys or random suffixes.
Cross-shard queries are slow. Design schemas so common queries hit single shards.
Rebalancing is complex. Plan for it.
Sharding is powerful but adds complexity. Use it when you've exhausted simpler options.