Hot tenants mean a wrong shard key: PlanetScale's three-step remedy
PlanetScale uses Slack's move from sharding by workspace to sharding by channel to explain when to scale up, when to isolate, and when to reshard.
Why it matters · Sharding by tenant is the default choice in multi-tenant SaaS, and it breaks when a few customers get much bigger than the rest. This post lays out the escalation path and describes how a key-range reshard is done without downtime.
Simeon Griggs of PlanetScale starts from a common situation. A database is sharded on tenant_id, which spreads tenants evenly at first. Then a few tenants grow far larger than the others, and the product starts needing cross-tenant queries. At that point an even spread of tenants matters less than an even spread of data. Griggs's diagnosis is that you probably have the wrong shard key, at least for some tables.
The post is written for Neki, PlanetScale's sharded Postgres product built by the Vitess maintainers, so it is partly a vendor pitch. The reasoning applies to any range-sharded system.
The Slack precedent
Slack first sharded messages and channels by workspace ID and kept the workspace-to-shard mapping in a separate metadata cluster. That rested on the assumption that no single customer would outgrow the largest database. It stopped holding once enterprise workspaces passed 100,000 users. Some workspaces' messages tables grew too large for any one shard. Then cross-workspace messaging and Enterprise Grid, which groups workspaces under one organization, made the workspace key awkward.
Slack moved to Vitess and chose a shard key per table: user ID, channel ID or workspace ID. Messages were always queried by channel and never by workspace, and channel ID was already in the primary key. Sharding messages by channel turned "fetch a channel and its messages" into a single-shard query, even when the authors came from different workspaces. Cross-channel queries became cross-shard, but those were limited to admin and batch jobs. Users stayed together by workspace because "all users in this workspace" is a hot access path.





