{"type":"video","version":"1.0","html":"<iframe src=\"https://www.loom.com/embed/1981c829d705487ebbaaf69f212434ab\" frameborder=\"0\" width=\"1920\" height=\"1440\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>","height":1440,"width":1920,"provider_name":"Loom","provider_url":"https://www.loom.com","thumbnail_height":1440,"thumbnail_width":1920,"thumbnail_url":"https://cdn.loom.com/sessions/thumbnails/1981c829d705487ebbaaf69f212434ab-bd8f898de7e2c8d8.gif","duration":853.413,"title":"Sharding, Scaling Out, Key Tradeoffs ⚙️","description":"In this Loom I start with the problem of having one database for everything, and how it becomes the bottleneck as users and load grow, with CPU and disk I O maxing out, latency going from milliseconds to seconds, and the system breaking. I explain vertical scaling versus sharding, where we scale out by splitting one database into multiple independent shards and routing requests using a shard key like user id. I cover range, hash, and geo based sharding, plus hard issues like cross shard transactions, rebalancing when adding shards, and avoiding cross shard joins with an aggregation layer. I request you not to shard too early, and only shard when the database is actually breaking."}