<?xml version="1.0" encoding="UTF-8"?><oembed><type>video</type><version>1.0</version><html>&lt;iframe src=&quot;https://www.loom.com/embed/1981c829d705487ebbaaf69f212434ab&quot; frameborder=&quot;0&quot; width=&quot;1920&quot; height=&quot;1440&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;</html><height>1440</height><width>1920</width><provider_name>Loom</provider_name><provider_url>https://www.loom.com</provider_url><thumbnail_height>1440</thumbnail_height><thumbnail_width>1920</thumbnail_width><thumbnail_url>https://cdn.loom.com/sessions/thumbnails/1981c829d705487ebbaaf69f212434ab-bd8f898de7e2c8d8.gif</thumbnail_url><duration>853.413</duration><title>Sharding, Scaling Out, Key Tradeoffs ⚙️</title><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.</description></oembed>