HasanAboShally
HasanAboShally

Reputation: 18675

using single database file for multiple users

I want to make a site in which every user has his own customers and products to manage. Whats the best way to handle this??

Is it OK to use an additional field for each entry specifying the user this entry belongs to ? or there is a better way?

Im using sql server if it matters.

Thank You.

Upvotes: 0

Views: 208

Answers (2)

JonH
JonH

Reputation: 33143

Do NOT I repeat do NOT create a database per user, not even a table per user. Add a column UserID to any table that may need to reference a person with a product or order.

Upvotes: 0

Randy
Randy

Reputation: 16677

not really much info in the question... however:

it is much simpler to scale some more data in a single database than to create additional databases. so YES - make one database.

the exact schema you choose is more subtle - normalize, and link rows to appropriate users

Upvotes: 1

Related Questions