toast0 8 days ago

This isn't really tangible, but the key reasons to shard are that your disk i/o and/or your database cpu usage expand beyond what you can service with a single reasonable priced host. Also, I guess if your database gets so big on disk it no longer fits on a single machine. Or your use is beyond what your memory i/o or network i/o can sustain.

These days, you can get server processors with hundreds of cores, terrabytes of ram, and nvme can do huge amounts of IOPS, but there's often a place in the pricing curve where it's less expensive to get two machines of X capacity than one machine of 2X capacity. Often, that point is near the limit of acheivable capacity, so when you notice it's getting more expensive to scale up than out, it's time to consider scaling out. Sharding has its own expenses, so scaling up can still be valuable, but you need to start preparing for the possibility that you can't.

1
levkk 7 days ago

From an infra management perspective, a multi-TB table is not fun to maintain. If you can comfortably shard before you get there, you'll be happy you did. Caveat being, sharding has to be ergonomic and not get in the way.