Reputation: 23
Scenario:-
Question:-
Is it advisable to replicate the table structure for each new instance of a company branch, or to use a new database for each new company registered to the system?
Upvotes: 2
Views: 196
Reputation: 9084
it depends on the developed system (Online or local), the required tasks (the query rate, and Reports),
If this company will always query the data for all branches or needs a frequent statistics and reports (now or in the future) then you must do it in one database.
if you are afraid of the performance then enhance the server capabilities and the database engine will manage the rest with no issues.
However, take into consideration that the database design will have a major effects on the performance so you will need to do it perfect by using indexes, correct relations, and mainly by understanding the current needs and the expected future needs, try to imagine every query or report that might be needed when the company is having the maximum expected number of branches,
I believe that one database will be enough for almost all scenarios, and remember that having many databases will cost a real headache in the future (mirroring, synchronizing, reporting, maintenance, backups..etc)
Upvotes: 2
Reputation: 555
The better structure is to have two tables Companies
and CompaniesBranches
Upvotes: 0