How do you determine how far to normalize a database?

前端 未结 13 2143
醉梦人生
醉梦人生 2020-11-29 06:36

When creating a database structure, what are good guidelines to follow or good ways to determine how far a database should be normalized? Should you create an un-normalized

13条回答
  •  粉色の甜心
    2020-11-29 07:24

    Often if you normalize as far as your other software will let you, you'll be done.

    For example, when using Object-Relational mapping technology, you'll have a rich set of semantics for various many-to-one and many-to-many relationships. Under the hood that'll provide join tables with effectively 2 primary keys. While relatively rare, true normalization often gives you relations with 3 or more primary keys. In cases like this, I prefer to stick with the O/R and roll my own code to avoid the various DB anomalies.

提交回复
热议问题