Which way to go in multitenant? #3912
-
I am creating a sports betting system and it must be multi tenant. Is it worth creating this multitenant system or is one server better for each client? And if it's better to go by the multitenant which way to go? How do I make a database for each client and make the request using the model for a specific database? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I personally would instead reach for a solution that you did not include in your original post. I would do one database, and use account_id on database records to identify which records belong to which tenant. This pushes tenancy up to be an application level concern. This means you have to add extra where clauses to all your queries. However, it has a lot of benefits.
My understanding is that this is the most common pattern for multi-tenancy in SaaS applications. |
Beta Was this translation helpful? Give feedback.
I personally would instead reach for a solution that you did not include in your original post.
I would do one database, and use account_id on database records to identify which records belong to which tenant.
This pushes tenancy up to be an application level concern. This means you have to add extra where clauses to all your queries.
However, it has a lot of benefits.
My understanding is that this is the most common pattern for multi-tenancy in SaaS a…