best video on multi tenancy i have seen so far. most others focus purely on having just multple dbs. after having been in a multi tenant project, i will refer to this video from now on
I've worked most of my career with transactional multitenant systems starting from key-partitioned tables and eventually moving to dedicated databases. The last thing you want to face is to mess up data between tenants. That's why I would always go for a model with a dedicated database for each tenant. Sharing a database between tenants will eventually result in customers calling and asking why do they see data from a wrong company. And the next, even harder question is are their data compromised also. I've seen that happen, believe me you don't want to be there. Database per tenant is also a great benefit when building test automation and CI. You just make sure users are redirected to correct tenant and from there it's just single tenant system all the way. No need to carry any tenant IDs in every query or making sure all current and future SQL will use it correctly. The obvious benefits include scaling and better performance overall. Not all tenants are equal. There will be that mammoth one slowing others down.
@@LuisRuizHalo It is possible however schemas are within the same database. They don't provide full isolation as it is technically possible to access other schemas in the database from a single connection. Keep in mind that you may need to migrate tenants to other clusters depending on resources available. Using schemas leads to performance issues sooner or later as they share the same resources.
I disagree. Having worked with 1 app with hundreds of dedicated databases (1 for each tenant), production releases become a nightmare. You update the application code, run updates to 500 databases, and for whatever reason the database 475 breaks down. Rollbacking from there is a potential nightmare.
@@zengouu Why would you need to rollback all if one database has issues? And on the other hand, what could cause an upgrade failure for one and not all? Database should only be altered by a single set of update scripts. We are currently doing over 10K tenant database upgrades every year with little to no issues. Everything is automated so databases are never altered manually at any point.
@@Greenthum6 Ie. It might be a scenario where the application can only work with a specific schema that is not backward compatible with the old one. Of course, fully automating everything is an option, but it also might be impossible cost-wise to a specific organization. I sincerely do get your point, but it's not all black and white like that. Ultimately, it comes down to the fact that you can't "always go for a model with a dedicated database for each tenant".
Project Orchard also has multitenant feature. Very few good tutorials out there. It does support in a decent way. It also covers the features which to turn on for which tenant.
Thank you so much for the informative video. Multitenancy, in general, is a bit challenging, especially when it comes to managing tenants and their subscriptions through a dedicated tenant administration portal. This is in conjunction with data isolation strategies such as a Shared Database for All Tenants and a Separate Database Per Tenant. We dedicated the past four years to analyzing and studying the best practices that should be considered when building a SaaS app using the Multitenancy approach.
If you want to become good in designing (the architecture) your system, I highly recommend watching all of his videos (these are not for beginner programmers tho)
at my work project, we were working on multi tenant model with first, pooled compute and partitioned DB, then because of some client request to customise some parts of bussiness logic...someone took decision to keep the codebase separate...nightmare started. overtime we have now 11 codebases to maintain
Had a question. How is Lanes(7:15) different from the Silo(1:18)? There seems to be siloed compute and siloed DB. I get the common login service, but keeping that aside what is the difference?
Assuming I’m building a CRM for a specific industry, is the shared schema approach better since every query will have the user ID to reference every table to make sure data doesn’t conflict. Or I will need the multi tenants approach
I would really like to know your take on Hexagonal Architecture aka Ports And Adapters Architecture. If possible, please, come up with a video on that.🙏
I'm currently working on something closely resemble farms, the different is, I have a service working as a proxy to hold the emails (the main access way) and the associated api that this email belongs to, after that, the presentation (Mobile app and blazor app) uses that api for all subsequent calls until a sign out is made. Watching this made me thinking if making a service for only an email check is an overkill, should it have the whole identity system, but I want each tenant to have a different jwt credential, and, with current implementation plan, there is only 2 methods exposed from the proxy, the first to register the email, the other is to check for the email, (Maybe an edit in the future), other methods are for the admin to spin up another tenant, these methods also required their own jwt credentials.
I have a project with multi tenant application i want to use background service for azure service bus i am using different database for different tenants hope u understood the problem, Do u have any suggestions for this problem how to connect to different database to connect to the queue because the connection strings for queus are in database
About the identity, the user get a token from Identity how to know the tenant to assign to ? My used a login "companyA\myusername", "companyB\myusername" depending of that I assign the tenant in the token but I think it's not the best way. What is the best way ?
Where do you feel Postgres schema separation fits into. IMO it’s the best of both worlds with the data isolation of separate DBs with the cost savings of a single DBs.
Hey mate, so informative videos. I have a quick question regarding how to inject tenant Id of a given user into user jwt token when it gets initiated? thanks
I enjoyed this video, thanks. I prefer the approach that uses a separate database per tenant, but I have a concern. When you have to modify the database schema (adding/modifying tables for example), would you have to update each database manually and separately?
Saas design using Hypermedia is pretty cool, Haven't thought of Saas that way. Its new to me. Have you/any one you know has really hit the ceiling with pooled & partitioned SaaS architecture and had to move on to Hyper media etc..? I've never built a Saas. One thing that really scares me is that pooled and partitioned might not be good enough for the long run and migrating between pooled & partitioned to something else will be a big headache;
I have a question: I am developing an application, where the user can have access to multiple Databases in some cases. And new groups could be added in real time with their own databases. How can I query multiple siloed databases based on user privileges? Thanks in advance
hi thanks for the information which very clearly explained just want to know if you have a code sample for "Multi-Tenant pooled & partitioned" which uses seperate identity server to return tenant and then login to client application thanks in advance
Could you please clarify me on how to retrieve identity. I wont be taking any additional value, except for loginid and password. Based on these two i have to retrieve the tenant db name of the user, then use it for any other operation gng forward. As far as i have seen, some sites take OrganisationName in the login url, some depend on the domain of email address. What if i dont use these two. Does that mean i have to store all username and passwords of all tenants into one DB( say config db) and use this for login? This may lead to lot of new challenges
Hi, I think my question is not really related to this topic. But I need advices from experts in this situation: - My app allows users define their own objects - Should I allow users to define their own real table per each object? Or should I use a big table (for ex: Integer1, Integer2,... String1, String2, ...) Thanks
@@CodeOpinion Currently our app is using MSSQL server - it is relational database. But now, users want to define their custom objects. Do you have any advices on how database designing structure for this requirement? Thanks
What about each tenant using its own schema? Data logically separated and you dont have to filter out the data being retrieved, just set the proper schema when querying
Sure, that works. It's not any different than being silo'ed using different db instances because ultimately you need to know which schema to use (vs which instance to connect to).
How do you go about handling multi-tenancy in an event-sourced app where a consumer should be able to handle events from different tenants? I thought about creating different topics for each tenant, but then I would also need to create consumers that listen to those new topics. How would you go about aggregates in a case where many tenants can share the same topic? Is there a way to do this transparently without each consumer being aware that they are in a multi-tenant environment? I really would prefer not to rely on developers of each service making sure that they check tenant id and handle requests appropriately.
Same as the database really. Depends if you want to share it. You can make it seamless for the developer so they are unaware of where it's actually being published. Take that concern out of their hands.
Hi Sir, I need some advice from a professional like you. In my whitelabel saas application, My customers can buy whitelabel and customize the logo and title and payment gateway api key and payment amounts and link their own domain/sub domain names to that. I don't think a key will come in play and I'm stuck as how would my web app present the users of a "tenant" when searching his domain/sub domain on web. How will his version of my web app will be presented to them. How would my web app know to which version of the web app to show to which user?
I have the same question related to a broader topic of this kind asked in one of the earlier commets, too (re intra-group - within one business boundary - multitenancy with more complex filtering scenarios) / this is a really interesting and practical aspect
Depends if you have meaningful metrics or if you need to implement them for that purpose. For example, let's say it was a SaaS for e-comm. If you were charging per order placed, you'd know that by how many orders per tenant are in the DB.
For partitioned databases you can also do it by replicating tables for each tenant, tenant1_table1, tenant2_table1. Instead of saving all tenants data on the same table.
Sounds like a maintenance hell tbh. Imagine 100+ tenants.. And how about that day when your app joins tables between different tenants in production? It may be game over
@@Greenthum6 sure there are tradeoffs, all tenants in 1 table probably doesn't scale as well too. What you describe is also hard to do if you have 1 db per tenant, which in my opinion is the way to go. But of course, will depend on your requirements...
@@Mariojsnunes I mean the joins between two tenants should NEVER happen. Same goes for queries where accidentally returning rows from wrong tenant may result in legal actions. Messing up is going to happen eventually as any query may break it. One database per one tenant is the only sane option if your application works with business critical data. Integration testing and any kind troubleshooting would be difficult if you always need to map a specific tenant to a set of table names since all SQL must be tailored at all times.
Tenants needing to communicate with each other I was going to bring up. But ultimately it's not very far off as a request from a "client" and a request from tenant are treated the same.
@@CodeOpinion a similar issue poped-up in my mind too; I am thinking how to best architect a solution with sort of "intra-group multitenant" construct: having one business but with a few subsidiaries and HQ all comprising one group, whereas two (or three?) main filtering criteria are applied: (a) by org and hierarchy levels and (b) by functional line (with various /org/hierarchy/scenario access rights combinations/limitations though); at HQ-mngt they have access to all and any levels/units records (with some filtering of functional reporting areas for all N-x user levels down in a specific org), and at a sub (tenant) level not only subs's users (internal tenants) could only access their respective organisation records (filter by org), but also apply filtering for their functional area/responsibility and hierarchy level. It is more or less crear how RLS tooling works for the RDBMS (e.g. MS SQL) natively but I hesitate with c# code exactly yet on the best approach. And this surely involves cross-tenant aggregation and querying, so I presume separate DBs is not a viable option and partitioning is a closer route. / If you plan to continue developing the Multitenant talk to that deep - it will be so great to inspire some ideas!
Multi Tenant is nice when your app share the same logic and that's it . But when maybe a distributor from a different car seller say " i want to remove one field " you can change that for just one client , you have to change your entire app for only one client. Clients are stupid sometimes.
Your architecture is a recipe to go bankrupt. You are thinking from technology standpoint and not business problems standpoint. Great architecture starts by understanding business problem and solving one. In saas, you have to solve problem in below order to be successful. 1. Secured Cost effective solution 2. Maintainable and 3. Scalability Spinning up multiple instances and databases is not sustainable. It will put your saas solution expensive.
Creating new instances of db for every single customer take away all the benefits saas products can offer. Have you checked prices of some of popular saas products? Servicenow, hubspot and many others. New db instances solution is only viable for large companies (where you can charge separately for custom software setup). Most customers are mom and pop stores, how will you sell them solution for less than $10 where your cost is higher than that. I can go on and on to explain but to summarize, please re-read my previous comment.
@@HornOkay you didn’t watch the video did you? Derek showed the various options, including shared database and applications which would work in your mom and pop scenario. Before criticising, make sure you actually take the time to watch the videos.
@@HornOkay You obviously wouldn't have a database per instance if you're doing less than $10 MRR per customer, which is more of a B2C scenario. On the other hand, if you're doing something like $10k per tenant, having a database per tenant is perfectly viable.
I don't know why am re-visiting this video over and over!
Because it's so entertaining and informative? 😂
Increased exposure over varying contexts aids in memory retention?
best video on multi tenancy i have seen so far. most others focus purely on having just multple dbs. after having been in a multi tenant project, i will refer to this video from now on
Glad it helped.
You just gained a new subscriber! Excellent video!
Appreciate it, welcome aboard!
I've worked most of my career with transactional multitenant systems starting from key-partitioned tables and eventually moving to dedicated databases. The last thing you want to face is to mess up data between tenants. That's why I would always go for a model with a dedicated database for each tenant. Sharing a database between tenants will eventually result in customers calling and asking why do they see data from a wrong company. And the next, even harder question is are their data compromised also. I've seen that happen, believe me you don't want to be there.
Database per tenant is also a great benefit when building test automation and CI. You just make sure users are redirected to correct tenant and from there it's just single tenant system all the way. No need to carry any tenant IDs in every query or making sure all current and future SQL will use it correctly. The obvious benefits include scaling and better performance overall. Not all tenants are equal. There will be that mammoth one slowing others down.
What about using a "Database schema per tenant" pattern? This could be done with RDMS like PostgreSQL.
@@LuisRuizHalo It is possible however schemas are within the same database. They don't provide full isolation as it is technically possible to access other schemas in the database from a single connection. Keep in mind that you may need to migrate tenants to other clusters depending on resources available. Using schemas leads to performance issues sooner or later as they share the same resources.
I disagree. Having worked with 1 app with hundreds of dedicated databases (1 for each tenant), production releases become a nightmare. You update the application code, run updates to 500 databases, and for whatever reason the database 475 breaks down. Rollbacking from there is a potential nightmare.
@@zengouu Why would you need to rollback all if one database has issues? And on the other hand, what could cause an upgrade failure for one and not all? Database should only be altered by a single set of update scripts. We are currently doing over 10K tenant database upgrades every year with little to no issues. Everything is automated so databases are never altered manually at any point.
@@Greenthum6 Ie. It might be a scenario where the application can only work with a specific schema that is not backward compatible with the old one. Of course, fully automating everything is an option, but it also might be impossible cost-wise to a specific organization. I sincerely do get your point, but it's not all black and white like that. Ultimately, it comes down to the fact that you can't "always go for a model with a dedicated database for each tenant".
9:33 Managing Multi-Tenant Data & Compute Resources:
Data Siloing and Partitioning, Using Load Balancers or Proxy Servers,& Router Configuration
Project Orchard also has multitenant feature. Very few good tutorials out there. It does support in a decent way. It also covers the features which to turn on for which tenant.
I came here while searching for the same.
Are u still working on multitenancy?
Thank you so much for the informative video. Multitenancy, in general, is a bit challenging, especially when it comes to managing tenants and their subscriptions through a dedicated tenant administration portal. This is in conjunction with data isolation strategies such as a Shared Database for All Tenants and a Separate Database Per Tenant. We dedicated the past four years to analyzing and studying the best practices that should be considered when building a SaaS app using the Multitenancy approach.
Awesome content! Learned a ton while designing my saas for aws!
If you want to become good in designing (the architecture) your system, I highly recommend watching all of his videos (these are not for beginner programmers tho)
Hopefully they help.
Very helpful video. Well explained. Thank you!
at my work project, we were working on multi tenant model with first, pooled compute and partitioned DB, then because of some client request to customise some parts of bussiness logic...someone took decision to keep the codebase separate...nightmare started. overtime we have now 11 codebases to maintain
Had a question. How is Lanes(7:15) different from the Silo(1:18)? There seems to be siloed compute and siloed DB. I get the common login service, but keeping that aside what is the difference?
Thanks, it helps a lot!
Thanks! This video shared so many things i never knew about multitenancy.
Glad it was helpful!
thank you for such as a fantastic tutorial. Short, Easy and Professional thanks
You're very welcome!
Thank you for this video. I appreciate it!
Assuming I’m building a CRM for a specific industry, is the shared schema approach better since every query will have the user ID to reference every table to make sure data doesn’t conflict. Or I will need the multi tenants approach
Great video! I’m wondering if we can achieve multi-tenant using a single DB and cone the schema per client
this video, covers a lot. i mean a a lot.
Ya, it's a big topic for a 11 min video 😀
I would really like to know your take on Hexagonal Architecture aka Ports And Adapters Architecture. If possible, please, come up with a video on that.🙏
Check out this video: ruclips.net/video/Ys_W6MyWOCw/видео.html
I'm currently working on something closely resemble farms, the different is, I have a service working as a proxy to hold the emails (the main access way) and the associated api that this email belongs to, after that, the presentation (Mobile app and blazor app) uses that api for all subsequent calls until a sign out is made.
Watching this made me thinking if making a service for only an email check is an overkill, should it have the whole identity system, but I want each tenant to have a different jwt credential, and, with current implementation plan, there is only 2 methods exposed from the proxy, the first to register the email, the other is to check for the email, (Maybe an edit in the future), other methods are for the admin to spin up another tenant, these methods also required their own jwt credentials.
Isn't it the same as passing the tenant id as a parameter, but build in?
Great explanation
I have a project with multi tenant application i want to use background service for azure service bus i am using different database for different tenants hope u understood the problem, Do u have any suggestions for this problem how to connect to different database to connect to the queue because the connection strings for queus are in database
About the identity, the user get a token from Identity how to know the tenant to assign to ? My used a login "companyA\myusername", "companyB\myusername" depending of that I assign the tenant in the token but I think it's not the best way. What is the best way ?
Where do you feel Postgres schema separation fits into.
IMO it’s the best of both worlds with the data isolation of separate DBs with the cost savings of a single DBs.
You mean single instance with multiple schemas. Sure.
How would you handle this scenario with Entity framework? Is there an easy way?
Hey mate, so informative videos. I have a quick question regarding how to inject tenant Id of a given user into user jwt token when it gets initiated? thanks
Could be claim within the token
@@CodeOpinion okay. How would the jwt provider know this value and append it into claims?
I enjoyed this video, thanks. I prefer the approach that uses a separate database per tenant, but I have a concern. When you have to modify the database schema (adding/modifying tables for example), would you have to update each database manually and separately?
The way to go will be to automate the updates with database migration scripts
just wondering, this can be achieved with a username password kind of logic right?
Saas design using Hypermedia is pretty cool, Haven't thought of Saas that way. Its new to me. Have you/any one you know has really hit the ceiling with pooled & partitioned SaaS architecture and had to move on to Hyper media etc..? I've never built a Saas. One thing that really scares me is that pooled and partitioned might not be good enough for the long run and migrating between pooled & partitioned to something else will be a big headache;
Don't use auto increment IDs if you want to go from silo'ed databases to partitioned.
@@CodeOpinion mmh.. That's to ease the db distribution right?
I have a question:
I am developing an application, where the user can have access to multiple Databases in some cases. And new groups could be added in real time with their own databases. How can I query multiple siloed databases based on user privileges?
Thanks in advance
Mapping or some relation to know which they have access to.
hi thanks for the information which very clearly explained just want to know if you have a code sample for "Multi-Tenant pooled & partitioned" which uses seperate identity server to return tenant and then login to client application thanks in advance
Just the sample code shown in the video. I don't have a full sample app that illustrates it.
Hi, can you tech how ngnix configuration for multy-tenent
Could you please clarify me on how to retrieve identity. I wont be taking any additional value, except for loginid and password. Based on these two i have to retrieve the tenant db name of the user, then use it for any other operation gng forward.
As far as i have seen, some sites take OrganisationName in the login url, some depend on the domain of email address.
What if i dont use these two.
Does that mean i have to store all username and passwords of all tenants into one DB( say config db) and use this for login?
This may lead to lot of new challenges
Often the tenantId (org id, whatever) will be sent apart of a some type of bearer token which contains other claims.
Hi, I think my question is not really related to this topic. But I need advices from experts in this situation:
- My app allows users define their own objects
- Should I allow users to define their own real table per each object? Or should I use a big table (for ex: Integer1, Integer2,... String1, String2, ...)
Thanks
Sounds like you don't want a relational database but rather a document store.
@@CodeOpinion Currently our app is using MSSQL server - it is relational database. But now, users want to define their custom objects. Do you have any advices on how database designing structure for this requirement? Thanks
What about each tenant using its own schema? Data logically separated and you dont have to filter out the data being retrieved, just set the proper schema when querying
Sure, that works. It's not any different than being silo'ed using different db instances because ultimately you need to know which schema to use (vs which instance to connect to).
How do you go about handling multi-tenancy in an event-sourced app where a consumer should be able to handle events from different tenants? I thought about creating different topics for each tenant, but then I would also need to create consumers that listen to those new topics. How would you go about aggregates in a case where many tenants can share the same topic? Is there a way to do this transparently without each consumer being aware that they are in a multi-tenant environment? I really would prefer not to rely on developers of each service making sure that they check tenant id and handle requests appropriately.
Same as the database really. Depends if you want to share it. You can make it seamless for the developer so they are unaware of where it's actually being published. Take that concern out of their hands.
Hi Sir, I need some advice from a professional like you.
In my whitelabel saas application, My customers can buy whitelabel and customize the logo and title and payment gateway api key and payment amounts and link their own domain/sub domain names to that.
I don't think a key will come in play and
I'm stuck as how would my web app present the users of a "tenant" when searching his domain/sub domain on web. How will his version of my web app will be presented to them. How would my web app know to which version of the web app to show to which user?
This is the part of SaaS/Multi-tenant I am looking for, as well. If you've figured out a solution, let us know!
So the idea is to add tenantId in many tables when needed
If you're going to share same underlying database, yes it's an option.
Is this a good candidate for row level security?
Could be, assuming your database supports it.
I have the same question related to a broader topic of this kind asked in one of the earlier commets, too (re intra-group - within one business boundary - multitenancy with more complex filtering scenarios) / this is a really interesting and practical aspect
How to calculate the billing for shared resources?
Depends if you have meaningful metrics or if you need to implement them for that purpose. For example, let's say it was a SaaS for e-comm. If you were charging per order placed, you'd know that by how many orders per tenant are in the DB.
@@CodeOpinion - Many thanks for your response, is there any sample architectures we’re available to refer though?
For partitioned databases you can also do it by replicating tables for each tenant, tenant1_table1, tenant2_table1. Instead of saving all tenants data on the same table.
also true. but it's easier to just use a database that supports partitions so this is all done under the hood. e.g. postgres.
Sounds like a maintenance hell tbh. Imagine 100+ tenants.. And how about that day when your app joins tables between different tenants in production? It may be game over
@@Greenthum6 sure there are tradeoffs, all tenants in 1 table probably doesn't scale as well too.
What you describe is also hard to do if you have 1 db per tenant, which in my opinion is the way to go.
But of course, will depend on your requirements...
@@Mariojsnunes I mean the joins between two tenants should NEVER happen. Same goes for queries where accidentally returning rows from wrong tenant may result in legal actions. Messing up is going to happen eventually as any query may break it. One database per one tenant is the only sane option if your application works with business critical data.
Integration testing and any kind troubleshooting would be difficult if you always need to map a specific tenant to a set of table names since all SQL must be tailored at all times.
What is a tenant? How is it different from a user/client?
Tenant is a person/company/group of users. Just like a tenant in an apartment. The tenant is the customer who occupies property within a building.
That’s great and all, but when it comes to cross tenant capabilities of the system its a bit of pain :)
Tenants needing to communicate with each other I was going to bring up. But ultimately it's not very far off as a request from a "client" and a request from tenant are treated the same.
@@CodeOpinion a similar issue poped-up in my mind too; I am thinking how to best architect a solution with sort of "intra-group multitenant" construct: having one business but with a few subsidiaries and HQ all comprising one group, whereas two (or three?) main filtering criteria are applied: (a) by org and hierarchy levels and (b) by functional line (with various /org/hierarchy/scenario access rights combinations/limitations though);
at HQ-mngt they have access to all and any levels/units records (with some filtering of functional reporting areas for all N-x user levels down in a specific org), and at a sub (tenant) level not only subs's users (internal tenants) could only access their respective organisation records (filter by org), but also apply filtering for their functional area/responsibility and hierarchy level. It is more or less crear how RLS tooling works for the RDBMS (e.g. MS SQL) natively but I hesitate with c# code exactly yet on the best approach. And this surely involves cross-tenant aggregation and querying, so I presume separate DBs is not a viable option and partitioning is a closer route.
/ If you plan to continue developing the Multitenant talk to that deep - it will be so great to inspire some ideas!
Give me a Source code sir
thanks a lot
How do you generate the slides for this topic ?
Powerpoint
Multi Tenant is nice when your app share the same logic and that's it . But when maybe a distributor from a different car seller say " i want to remove one field " you can change that for just one client , you have to change your entire app for only one client.
Clients are stupid sometimes.
You can do custom fields. Dynamically generated Fields: textbox, select, date, etc
I decided my next car is no car. (Remote office and when I need one we have car sharing all around the block
Your architecture is a recipe to go bankrupt. You are thinking from technology standpoint and not business problems standpoint. Great architecture starts by understanding business problem and solving one.
In saas, you have to solve problem in below order to be successful.
1. Secured Cost effective solution
2. Maintainable and
3. Scalability
Spinning up multiple instances and databases is not sustainable. It will put your saas solution expensive.
I suggest watching other videos of mine.
You can price that in? This isn't a $9.99 a month scenario.
Creating new instances of db for every single customer take away all the benefits saas products can offer.
Have you checked prices of some of popular saas products? Servicenow, hubspot and many others.
New db instances solution is only viable for large companies (where you can charge separately for custom software setup). Most customers are mom and pop stores, how will you sell them solution for less than $10 where your cost is higher than that.
I can go on and on to explain but to summarize, please re-read my previous comment.
@@HornOkay you didn’t watch the video did you? Derek showed the various options, including shared database and applications which would work in your mom and pop scenario.
Before criticising, make sure you actually take the time to watch the videos.
@@HornOkay You obviously wouldn't have a database per instance if you're doing less than $10 MRR per customer, which is more of a B2C scenario. On the other hand, if you're doing something like $10k per tenant, having a database per tenant is perfectly viable.