Recently I was designing a library table for an enterprise application project, and I encountered some data association problems. I was undecided whether it would be better to maintain within the code or make external associations. I am seeking the opinions of experts.
巴扎黑2017-05-17 10:10:48
Let me tell you my personal opinion.
Normally, it is recommended to use database foreign keys. This has relatively complete constraints. Moreover, most applications (80%) of most companies have not yet reached the level of database segmentation. So why not just rely on the integrity of the database? ?
Not using foreign keys is usually too large, so the number should be more than a million. Need to be segmented. Only manually use the program maintenance. . .
怪我咯2017-05-17 10:10:48
The demand is stable - use foreign keys
The demand changes frequently - don’t use it