News for hackers. Stuff that matters.
Re:Scaling Datastores at Slack with Vitess by wiredfool on Sunday December 06, 2020 @11:35AM (#25324536)
Sharding based on customer is an attractive way to get to shards, potentially with minimal interference in ops or data model, but truly sucks when your biggest customers don’t fit on one shard anymore.
Re:Scaling Datastores at Slack with Vitess by sougou on Sunday December 06, 2020 @12:40PM (#25325077)
The way to reason about this is: If a customer had a huge business, what key would they shard by? Then choose that as the sharding key for all customers.
Re:Scaling Datastores at Slack with Vitess by philsnow on Sunday December 06, 2020 @10:07PM (#25328978)
sougou is one of the original vitess devs, he would know this very well.

Hi Sugu!

Re:Scaling Datastores at Slack with Vitess by atombender on Sunday December 06, 2020 @01:29PM (#25325408)
The solution is to have different shard sizes. Your largest customer needs to fit on the largest shard size (extra large VMs or whatever).
Re:Scaling Datastores at Slack with Vitess by wiredfool on Sunday December 06, 2020 @01:34PM (#25325457)
Fins, but there comes a time when your largest customer doesn’t fit on your largest machine.

I wouldn’t say that killed my first startup, but it certainly didn’t help.

Re:Scaling Datastores at Slack with Vitess by continuations on Sunday December 06, 2020 @05:23PM (#25327187)
How big is your largest customer though?

You can easily buy a machine with several TB of RAM, several hundreds of TB of SSDs in RAID giving you millions of IOPS, quad-socket 256 cores. How likely is it that a single machine cannot handle a single customer?

Re:Scaling Datastores at Slack with Vitess by jjeaff on Sunday December 06, 2020 @07:31PM (#25328071)
Ya, this is always what I think about when I see people spending lots of effort on "scalability".

You either need an enormous client base or are doing something very specialized that requires tons of memory or cpu per customer.

I would think 99% of all internet companies could likely handle everything on a single massive machine, or two, for redundancy. Assuming they were somewhat optimized.

Re:Scaling Datastores at Slack with Vitess by derekperkins on Monday December 07, 2020 @01:14AM (#25329782)
That introduces different problems. Applying MySQL replication logs is single threaded by default and generally doesn't scale as well as the master, so it becomes increasingly difficult to keep replicas from lagging.

As your database gets into tens or hundreds of TBs, now backups and restores take hours or days to complete. Any DR scenario becomes an existential threat.

For large tables, schema changes can take weeks. This often results in developers doing their own custom table sharding strategies, even though they might still be on a single machine.

I'm not saying that you can't architect around these problems, but operating a db at massive scale on a single machine isn't the obvious win that it seems to be.

Re:Scaling Datastores at Slack with Vitess by atombender on Sunday December 06, 2020 @01:49PM (#25325592)
I guess I was assuming a shard was more than one machine. If a customer can't be horizontally scaled across nodes, then of course there's an upper limit on how large a shard can be.

Database like CockroachDB and TiDB help here.

Re:Scaling Datastores at Slack with Vitess by chevman on Sunday December 06, 2020 @04:38PM (#25326909)
Yeah, seems like the key point here is be careful architecting your infrastructure around a somewhat arbitrary construct like 'customer'. The relevant entity to scale around for Slack is likely 'active users' or even 'messages'. Which may map loosely to 'customers', but that's almost incidental.
Re:Scaling Datastores at Slack with Vitess by juancampa on Sunday December 06, 2020 @12:19PM (#25324904)
The article addresses this particular point

> Each keyspace is a logical collection of data that roughly scales by the same factor — number of users, teams, and channels. Say goodbye to only sharding by team, and to team hot-spots!

Re:Scaling Datastores at Slack with Vitess by kamikaz1k on Sunday December 06, 2020 @11:48AM (#25324622)
Has that ever happened to you? Would love to read about that story and hopefully the solution...