What is the best database design for thousands of rows

I am going to launch Database Designer , which will simply manage users under companies.

  • Each company will have an administrative area that can manage users.
  • Each company will have about 25,000 users.
  • The client estimates that around 50 companies will start

My main question is:

Should I create company-based tables ? as

users_company_0001 users_company_0002 users_company_0003...

since each company will never use "other" users, and nothing will have to sum / count different tables in all user_company (the simple one JOINwill do the trick, although it will be more expensive (time), it will work as having the main image, this never needed.

or I just need to create a table usersto have (50 x 25000) 1,250,000 users (and increase).

I am thinking of the first option, though, I'm not sure how to use the Entity Framework for such a layout ... I will probably need to go back to the 90s and generate my logical data level manually.

whether it will be a simple call to storage procedures containing the company identifier

What can you suggest?

ASP.NET (, MVC, , -, MVC - , , , ), Microsoft SQL.

+5
4

, 1-, - , . - :

alt text

+9

SQL Server , , SQL Server company users . , , - , . - , , . . RPM , . , . , - . , , .

+7

re: ?

users_company_0001 users_company_0002 users_company_0003

,

companyID  companyName, contactID

, (50 x 25000) 1 250 000 ( )

+3

, . : CompanyAdmin. - :

  • (Company_Id, Company_name,...)
  • (User_Id, User_name,...)
  • CompanyAdmin (Company_id, User_id)

/ , , . , , , (.. ) () .

With proper indexing, connection costs in a database containing several million rows should not be a problem.

Finally, if you ever need to change or record additional information about the Company, users or the relationship between them, this setting should have the least impact on your application.

+1
source

All Articles