Should I keep separate client codebases and databases for a software-as-a-service application?
- by John
My question is about the architecture of my application. I have a Rails application where companies can administrate all things related to their clients. Companies would buy a subscription and their users can access the application online. Hopefully I will get multiple companies subscribing to my application/service. What should I do with my code and database?
Seperate app code base and database per company
One app code base but seperate database per company
One app code base and one database
The decision involves security (e.g. a user from company X should not see any data from company Y) performance (let's suppose it becomes successful, it should have a good performance) and scalability (again, if successful, it should have a good performance but also easy for me to handle all the companies, code changes, etc).
For the sake of maintainability, I tend to opt for the one code base, but for the database I really don't know. What do you think is the best option?