开发者

table per client in database

We developing se开发者_如何学Pythonrvice were for each client user can make appointment. Is there strategy - table in database (MS SQL SERVER) for each client will be proper?

We think such strategy simplifies and exclude complex table locking.


It sounds like you are trying to build a multi-tenant application. I would not recommend one table per client. Rather, I would recommend one of two solutions:

  1. Integrate all client's (tenants) data into the same tables and segregate by an identifier. In other words, every top-level table would have a foreign key called "ClientId" or "TenantId" which would identify and separate each client's data. The downside to this approach is that the database gets much larger faster and large databases are more complicated to manage that smaller ones. In addition, there is a risk that a developer builds a query that forgets to filter on ClientId and one client sees another client's data.

  2. One database per client. A more extreme solution but useful if clients will host their own applications, if there is great disparity in the sizes of each client's data, or if client's want absolute assurance of data separation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜