2

Scenario:-

  • A company will have many branches and there will be many companies registering to the system.
  • All tables which store data about each branch will be the same for all companies.(eg:- employee table, services table,etc.)

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?

2 Answers 2

2

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)

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much for the answer, this is the exact response i was looking for. We actually do have to query the database for all companies very frequently since the customer end requires details of all companies.
0

The better structure is to have two tables Companies and CompaniesBranches

2 Comments

i have both tables, and there is another set of tables such as, employee,stock,schedule,etc. What i want to know is, when adding new branches, should i re-create entire table structure for each additional branch, or just add all data to a single set of tables. Thank you for the quick response Abo!
I'm not sure so maybe you should wait for another answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.