MyName
MyName

Reputation: 2236

Deployment of multi-client application (best practices)

(I am not sure if this is the best place to post this question. If not, please redirect me to the appropriate stack exchange site.)

I am looking to deploy a web application for multiple clients.

The idea is that each client can only access his or hers own data. Let's say that the client is the owner of the application installation. Each installation can have multiple users.

I want all installations to be in my own hosting, so that I can better control the code and business model (the client will actually be paying for the usage of the service).

I am looking for technical options to perform this kind of deployment.

[Option 1]

On easy option to do this would be:

(I don't have the requirement for an User to be common to more than one client/installation).

However, this solution has a few drawbacks:

  1. requires changing most of the SQL code;
  2. there might be some performance impact since the database will have much more data (the data for all installations).
  3. mixing data of different clients in the same database may cause some issues (if there is a bug, its easier for someone to end up accessing some else's data);

So I would prefer an alternative where the data would be isolated.

[Option 2]

One alternative that I was considering was:

  1. For each installation, buy a DB from the hosting company
  2. Come up with a configuration scheme that allows associating each installation with the database where the connection should be performed.

For example, if the user accesses http://very-nice-app.com/client-3/ the code knows that it must connect to database-name-for-client-3. This could probably be implemented with some kind of configuration files that are loaded independently from the main code.

This solves the potential issue of data leaking, but requires me to maintain several databases (if DB tables change, it has to be done across multiple installations). This can probably be automated somehow.

[Question]

My question for you what would be some better alternatives for this kind of deployment.

Thanks.

Upvotes: 1

Views: 2723

Answers (1)

MyName
MyName

Reputation: 2236

Since this does not seam to be a very popular subject, I'll leave some links that I have found since posting the question:

Best practices for creating multiple web app instance

http://forums.devshed.com/mysql-help-4/practice-opinions-multi-user-multi-organisation-web-app-812530.html

I also asked the question in the DBA Stack Exchange where the post had a comment and a reply which lead to a brief discussion:

https://dba.stackexchange.com/questions/114330/web-application-for-software-as-a-service-shared-database-or-multiple-database/

In short, "it depends" :).

Upvotes: 1

Related Questions