Best way to design this database scenario?

前端 未结 5 387
你的背包
你的背包 2020-12-17 00:46

Requirement is to store attachments for different entity types.

Say we have 3 entity types Company , Department and Employee. Each can have multiple attachments (doc

5条回答
  •  死守一世寂寞
    2020-12-17 01:00

    Other things to consider:

    Are you going to need to roll up attachments? i.e. an employee's attachments are associated with his/her department and their company? if this is a frequent query a single attachment table and a separate and heavily index entity look-up table option may give better query performance.

    Also, Are the attachments going to be many and/or huge enough that you need to put those table(s) on a separate device, or another storage system (i.e. file system pointers)? Management is an issue as well as performance.

提交回复
热议问题