John Mathison
John Mathison

Reputation: 914

Multiple vs single database

We are developing a new version of our web application. We have multiple clients (500+), each client has its own database with its own data: users, products...

In the new version, all clients are going to share some data, for example, users are going to be in the platform but each client will be able to access to their users only, but instead of having the users for each client we want to have all the users in a centralize table.

Other things such as products, orders...are going to belong to each client.

Each client will have a copy of the web app installed in their domain. Our app is an ASP MVC Entity Framework Code First, using SQL Server.

Our question is:

PROS AND CONS:

Thanks for your advices.

EDIT

The thing here is not a question abou single vs multiple database because we have one more thing in the game, all clients need to access a common database.

EDIT 2

Let's say we have decided to go for a single database for all our clients. So we will have multiple domains, each one with our application running, but we need each of them getting only their data.

How can we do this? Adding a ClientId to each table and filtering the data with a parameter "clientId" in the web.config of each site?

Upvotes: 1

Views: 547

Answers (2)

Gurdev Singh
Gurdev Singh

Reputation: 2165

Option A would be the recommended approach as that will allow all different clients to query on their own selected transactional records and without any performance issues because of the requests from other clients.

Also, the option A would allow the entities based customization (if required in future) which would prove to be a challenge with option B. Multi-tenant based architecture is the recommendation.

The below mentioned resource can help you with some more options/possibilities.

https://msdn.microsoft.com/en-us/library/aa479086.aspx

Upvotes: 0

ste-fu
ste-fu

Reputation: 7482

My personal preference would be for option A, and the primary reason would be for security. You basically have only a couple of points of failure for leaking one client's data to another.

You could look to put a service on top of the common data and cache frequent requests for user data to handle that side of things.

Upvotes: 0

Related Questions