Reputation: 2236
(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.
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:
So I would prefer an alternative where the data would be isolated.
One alternative that I was considering was:
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.
My question for you what would be some better alternatives for this kind of deployment.
Thanks.
Upvotes: 1
Views: 2723
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
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:
In short, "it depends" :).
Upvotes: 1