How does database sharding work?
&gt; I suppose the more fundamental question is: why are you not using a database that does sharding for you? Over the past few years the so-called “serverless” database has gotten a lot more traction. Starting with the infamous Spanner paper, many have been thinking about how running a distributed system should be native to the database itself, the foremost of which has been CockroachDB. You can even run cloud Spanner on GCP.<p>This is the most important paragraph in the article. In a world where things like Dynamo&#x2F;Cassandra or Spanner&#x2F;Cockroach exist, manually-sharded DB solutions are pretty much entirely obsolete. Spanner exists because Google got so sick of people building and maintaining bespoke solutions for replication and resharding, which would inevitably have their own set of quirks, bugs, consistency gaps, scaling limits, and manual operations required to reshard or rebalance from time to time. When it&#x27;s part of the database itself, all those problems just... disappear. It&#x27;s like a single database that just happens to spread itself across multiple machines. It&#x27;s an actual <i>distributed</i> cloud solution.<p>My current employer uses sharded and replicated Postgres via RDS. Even basic things like deploying schema changes to every shard are an unbelievable pain in the ass, and changing the number of shards on a major database is a high-touch, multi-day operation. After having worked with Spanner in the past, it&#x27;s like going back to the stone age, like we&#x27;re only a step above babysitting individual machines in a closet. Nobody should do this.