This question already has an answer here:
- Supporting multitenancy 3 answers
I'm starting to design a web application, and I'm evaluating some decisions regarding the general structure of it. My use case is as follows:
- I plan to have multiple customers on a single server. Initially there won't be many customers, probably two to start (but the system should be ready for more, of course). As I'm working as a single developer, I want to save cost in servers, SSL certificates and so on
- Each customer can have different users for their own data, with different permissions
- A customer should not be able to access data from other customer, unless the other explicitly allows him (i.e. creating a user for him)
I was evaluating how to handle this multiple customer scenario, and right now I'm planning to separate each customer in its own DB (and deciding which DB to connect with the customer URL, for example). Managing everything in the same DB would be, I think, error-prone (an error in the app would let a customer view data it shouldn't) and complicate my design (I would have to store the customer with all data).
So I would like to know what advantages and disadvantages come with this kind of design. Is there a performance issue? Maintenance problems? Security problems?
If that matters, my platform of choice is Python + Flask + SQLAlchemy (though I'm evaluating Django too)