Are foreign keys really necessary in a database design?

前端 未结 24 2368
执笔经年
执笔经年 2020-11-28 18:08

As far as I know, foreign keys (FK) are used to aid the programmer to manipulate data in the correct way. Suppose a programmer is actually doing this in the right manner alr

24条回答
  •  醉酒成梦
    2020-11-28 18:26

    I can't imagine designing a database without foreign keys. Without them, eventually you are bound to make a mistake and corrupt the integrity of your data.

    They are not required, strictly speaking, but the benefits are huge.

    I'm fairly certain that FogBugz does not have foreign key constraints in the database. I would be interested to hear how the Fog Creek Software team structures their code to guarantee that they will never introduce an inconsistency.

提交回复
热议问题