Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multi Instance or Multi Tenant

Status
Not open for further replies.

G12Consult

Programmer
May 12, 2016
77
AU
Hi,

I am hoping for some advice.

I have to develop a database which will become the back end of a web application.

I have read about multi tenant vs multi instance and I am still not 100% sure what would be the best approach. I believe some SaaS platforms have a blend of both?

My scenario

I will be developing a web platform whereby businesses will be able to create their own business accounts. They will then add their own clients to this platform.

I want to be able to make changes to the front end which will replicate to all signed up businesses with one change rather than having to update multiple front ends. I guess likewise if I make a database change as well. Wouldn't want to replicate this change to 100's of databases.

I also want to ensure that businesses can only access their own data. I understand I could do this at application level as long as I store some kind of key for each business.

Has anyone built something like this before and what approach did you feel worked best or would recommend?

I am sure not of 1 database with all the data contained and 1 front end, or 1 front end with multiple databases.

Any help is appreciated.

Regards
Andrew
 
My advise is not to mix multiple clients on same database - but you may be confusing instances with databases along side multi instance vs multi tenant.

you say you don't wish to make changes to more than 1 DB when the need arises - that is all good but in practice you are limiting how you can balance the load you may end up having.
Single DB == Single Instance == single point of failure == shared resources.
Multiple DB allows you to do
== Multiple or single instance - if one of the customers needs more resources you can just move their DB to another instance without affecting the others.
== Shared or single usage of resource -- while many customers may be able to share resources, others may require dedicated resources due to load.
== going Multi instances if one fails the others keep working away.

As for doing the deployments - that is what automation/devops/CI are for. With the push of a button all your changes can be deployed to all the tenants or just part of them. This may be a requirement with high volumes as db changes may require downtime and the bigger the db the longer the downtime may turn out to be.
Better to have 100 clients waiting 10 seconds for a change than 100 clients waiting for 20 minutes for a change to be implemented.

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Thank you for your advice. Much appreciated.

I have been researching further and thought about having multiple databases for each tenant. At the moment there are only about 3 businesses so it will be manageable.







 
I have a further question regarding authentication.

If I was using asp.net to develop a web application, what would be the best approach when using forms based authentication.

Should I have a separate global database will all users from every tenant and authenticate against that or have the authentication performed at the tenant db level but have a global user reference table with the database connection string so when the person logs in, it takes their username and looks up the database connection and then authenticates against the returned tenant db string accordingly.

My aim as an admin is to be able to query all users in the system at some point, so thought this would be easy having users stored in one table.
 
I never provided a SaaS solution, but imagine you'll have means to not only manage the companies being your customers but also the individual customer users on the level of the cloud provider you're using to offer your SaaS solution, be it GCP, AWS or Azure.

If not or you're going for your own mechanism embedded in your Software. I wonder if that's really the way to go. Making use of the thought of ways to scale in a cloud and offer SaaS solutions I imagine that'd go as far down to the detail a single employee at any of your corporate customers would have a single sign on with his smartcard in both that companies LAN and whatever cloud services they subscribe to without additional logins. I mean from the perspective of a company one benefit of cloud instead of single internet webapps is that the cloud should extend your own LAN infrastructure or even outsource much of it into the cloud.

So, I'd look into how that's meant to work. I am not so deep into that topic and it might only be in that ideal state for simpler things like core database use or exchange or anything a cloud provider offers directly without a third party SaaS provider like you are becoming. But isn't that the big promise aside of scalability?

Bye, Olaf.

Olaf Doschke Software Engineering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top