I have written a PHP application with CodeIgniter. I plan to sell it as a hosted application (Software as a service).
The apps allow users to:
My question is:
What is the best configuration for a hosted application? Keep in mind that the application can grow to couple of thousands of users.
The actual configuration is:
user1.example.com
user2.example.com
.................
All subdomains point to the same example.com/appfolder
All looks fine for 100, 200, 300 users but if I will have 1000 or 2000 users i will have to manage and backup 1000 or 2000 databases (3-5MB each)
I know I should have a single database for all users but this will make it very hard to manage and there is sensitive data on user databases.
And most important, users can create users that can use the same application but only on the subdomain where they were created by the admin user (which signup on exmaple.com)
Can this configuration crash a dedicated server with over 2000 admin users (which means 2000 db)?
Basic is very similar to a CMS but more specialized.
There are more practical ways to do this configuration?
Any suggestions will be greatly appreciated. Many thanks in advance.
A Single database or a sharded database (http://www.codefutures.com/database-sharding/ ) storing data for all your users is faster, easier to maintain, less cumbersome and all round better than 2000 databases.
Write the code you need to to manage your security or you'll be kicking yourself later when you are trying to wrestle with updating 2000 databases with a small schema change.
My suggestion would be to go with a single domain (no subdomains) and once you have 2000 users you will have the money and resources to improve.