4 ms·
Are there use cases where the database schema may differ slightly between tenants? How would migrations/schema changes propagate thru 1000 databases? What if it
by mattbrewsbytes 5y ago
Are there use cases where the database schema may differ slightly between tenants? How would migrations/schema changes propagate thru 1000 databases? What if it fails on one database? That sounds like a nightmare to maintain.
Your goal is to scale the application and I think the way is to change the multi-tenancy to store the tenant id in each relevant table as well as indexes on that column for every table since the majority of queries will have tenant_id.
The load balancing part depends on what your app is doing, you could segment web traffic based on URL or whatever per tenant to different servers. Or all traffic goes to all servers and scope when using DB is the tenant_id, then you treat all traffic the same and the load balancer just ensures even-ish traffic across a pool of web servers.