I am creating a multi-user / corporate web application in PHP and MySQL. I am interested to know what is best for structuring my database.
There will be hundreds of companies and thousands of users in this web application, so this should be reliable. Each company will not be able to see the data of other companies, only their own. We will mainly store text data and probably only have a few MB for each company.
Currently, the database contains 14 tables (for one typical company).
Is it better to place data for all companies and their users in one database and create a unique company identifier for each of them?
or
Is it better to put the data of each company in its own database and create a new database and table for each new company that I add?
What are the pros and cons for each approach?
Thanks,
Stephen
source
share