Reputation: 29
I need to develop project which serve businesses (can reach thousands of businesses). Each business has its own clients, suppliers, documents, vehicles list and more tables.
Each table may have 5k rows and more (can even reach a few million).
Should I have a separate database for each business, or a single database with huge tables which have a business identity column?
Setup 1
db1
table1 - x rows
table2 - x rows
tablen - x rows
db2
table1 - x rows
table2 - x rows
tablen - x rows
dbn
table1 - x rows
table2 - x rows
tablen - x rows
vs
Setup 2
db
table1 - n * x rows
table2 - n * x rows
tablen - n * x rows
Upvotes: 0
Views: 88
Reputation: 1271241
The database should have one set of tables for all businesses, unless you have an overriding reason for structuring things differently. Here are some reasons:
There are undoubtedly other reasons as well.
Upvotes: 2