I plan to create a multi tenant saas WebApp with NestJs + Prisma + MySQL as backend.
One Database each table hat a id and tenant_id column.
For approximately 100 Tenants each tenant had about 2000 users.
I plan to Identify each tenant by header X-Tenant-Id: tenant1
I have found somethin about Durable provider in the NestJS docs:
Durable provider
But in there is a Hint that this strategy is not ideal for applications operating with a large number of tenants.
What is a “large number of tenant” and what is the best alternative ?
Is there a best practice example for NestJS & Prisma Multi tenancy ?
For scaling I plan something like this, but is this a good idea ?
Databse Server 1
with DB 1 and Tenant 1 – 10
with DB2 and Tenant 10-20
with DB 3 and Tenant 20-30
Databse Server 2
with DB 4 and Tenant 40-50
with DB 5 and Tenant 50-60
with DB 6 and Tenant 60-70
Databse Server 3
with DB 4 and Tenant 70-80
with DB 5 and Tenant 80-90
with DB 6 and Tenant 90-100