Many to Many Relation Design - Intersection Table Design

后端 未结 11 1465
野的像风
野的像风 2020-12-07 19:20

I\'m wondering what a better design is for the intersection table for a many-to-many relationship.

The two approaches I am considering are:

CREATE TA         


        
11条回答
  •  庸人自扰
    2020-12-07 20:03

    Benefits of the first one:

    The ability to look up the join table by a single value. This makes some look up operations simpler on the client side.

    Some ORMs (NHibernate) also require ids in each entity for persistence to work properly.

    Benefits of the second one:

    Simpler data model, with no need to create the additional index.

    Less memory required.

提交回复
热议问题