SQL-Server DB design time scenario (distributed or centralized)

陌路散爱 提交于 2019-11-29 12:46:59

I would say that your 2nd option is close, just few points:

Customer, Distributor, Vendor are TYPES of organizations, so I would suggest:

  1. Table [Organization] which has all columns common to all organizations and a primary key for the row.

  2. Separate tables [Vendor], [Customer], [Distributor] with specific columns for each one and FK to the [Organization] row PK.

The sounds like a "supertype/subtype relationship".

I have worked on various applications that have implemented all of your options. To be honest, you probably need to take account of the way that your users work with the data, how many records you are expecting, commonality (same organisation having multiple functions), and what level of updating of the records you are expecting.

Option 1 worked well in an app where there was very little commonality. I have used what is effectively your option 3 in an app where there was more commonality, and didn't like it very much (there is more work involved in getting the data from different layers all of the time). A rewrite of this app is implementing your option 2 because of this.

HTH

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!