How do you effectively model inheritance in a database?

后端 未结 9 1594
南旧
南旧 2020-11-22 05:37

What are the best practices for modeling inheritance in databases?

What are the trade-offs (e.g. queriability)?

(I\'m most interested in SQL Server and .NET,

9条回答
  •  Happy的楠姐
    2020-11-22 06:10

    Short answer: you don't.

    If you need to serialize your objects, use an ORM, or even better something like activerecord or prevaylence.

    If you need to store data, store it in a relational manner (being careful about what you are storing, and paying attention to what Jeffrey L Whitledge just said), not one affected by your object design.

提交回复
热议问题