For my angularJS application I'm using asp.net web api backend.

For B2C I'm normally have one scalable backend application and each customer can have an account to use the services. There is one database and each customer has access to it like Facebook or Foursquare.

But how would I do that in a B2B SaaS application? Should I host for each company an own backend application with an own database? Or is it ok to host also one backend application for all companies? If then, how would I separate the data belonging to the companies?

For example:

Separate hosted apps for each company:

app --> companyA --> dbA

app --> companyB --> dbB

One hosted app for all companies with one database for all:

       --> companyA -- 
app --|               |--> db
       --> companyB -- 

One hostet app for all customer with different databases for each company:

       --> companyA --> dbA
app --|
       --> companyB --> dbB

If I have just one app, how would I make sure, that each company only has access to their data or to the database belonging to the company?

Please can you point me in the right direction? What are the best practices to do that? For example, when I am using Azure as cloud provider and Azure table storage as database, would each company get their own storage account?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.