Searching for any suggestions or advise as well as guidelines. I've developed a web-based database using php and mysql. It enables companies to log complaints and resolutions etc. There's a person database for login along with a cip database for logging the primary data. 2 information mill trialing and testing the database. Right now each clients are using separate databases and separate html pages. I'm wondering what the easiest method to increase the companies.
Ideas which i have are:

1. To possess one large database for customers and something large database for cip and employ a business id or much like identify individual companies records within the database.

2. To make use of exactly the same html pages for each company but choose which database to make use of in the login particulars. To ensure that each company may have another cip database but all companies make use of the same customers database.

3. Or simply keep everything separate for each company. (this can be really harmful to doing updates)

I really hope I've made myself obvious and anticipate any suggestions.

Thanks

Personally I'd choose candidate #3. Aside from the customers part, most of these databases can grow large quickly. To help keep performance to some maximum you should keep the tables no more than you are able to. Choosing another database in line with the user's qualifications should not be difficult to do, so application logic should not suffer.

I realize your worry about maintainability. Does every customer survive the identical application stack or have they got separate installations? Eitherway, maintenance ought to be easily scriptable to do multi database updates. That should not hold you back for selecting a design such as this.

It is really an interesting situation of the conflict involving the convenience as well as your responsibility and also hardwearing . customers' data secure. For your benefit, it's pretty obvious a multi-tenant application, as referred to inside your option (1), would be the simplest to obtain working.

But you're purchasing your serious problem for future years, when your business succeed. How you have referred to the application, there's never the best requirement for your customer companies to determine data owned by another. Actually, when they would see one anothers' data, you'd possess a serious security breach to cope with. When the breach involved personal records, you'd face business-threatening costs and penalties.

If you do choose option (1) don't shortcut your code inspection and security testing. Should you choose poor security testing you will be sorry, and worse, same goes with your clients.

For better security you might want to consider a mix of option (2) and (3): just one web application code base, moving your multiple-tenancy locus on the internet application towards the mySQL server. The mySQL home security system is half way decent proficient at multiple tenancy: Wordpress, Drupal, and Joomla all work this way, and they are all broadly used.

This method has an additional. Should you choose the expansion work essential to build simple installation scripts for the web application and database, you'll have the ability to provide your application to clients to operate by themselves servers if that is what they need.

I am not to imply avoid (1) completely. Your company might provide a located multi-tenant application (option 1) solution, with tos to pay for your risks. And, for bigger or better-outfitted clients you can provide the private solution.