3 ms·
Here is how to do it with zero downtime: Each customer has a completely separate data set, except maybe for login information. This makes it a good candidate f
by zimbatm 9y ago
Here is how to do it with zero downtime:
Each customer has a completely separate data set, except maybe for login information. This makes it a good candidate for sharding. Sharding is also a good idea because eventually one big ticket sale event is going to hog the whole system and having a way to isolate it allows the rest of the customers to keep working.
1) Add a shard ID to the customer table. If it's blank, use the existing database.
2) Create additional master-slave pairs with the same DB schema
3) Create a tool to migrate customer data between databases
4) Migrate customers individually, creating minimal downtime during their transition. With streaming replication this can be turned to zero downtime.
Wordpress has similar scaling issues and talked a lot on how they do it.