Answer the question
In order to leave comments, you need to log in
What is the advantage of Foreign Key as Primary Key?
Since we are talking about RDB,
Doctrine 2 Docs
is used as an example.
Everything is great, but apart from reducing the sampling speed, I do not see any obvious advantages.
For example, there is a User entity and it has UserDetails.
User (password, email, id, nickname), UserDetails (bornAt, firstName, lastName, adress, description....)
Now I use the usual approach with Natural key surrogate key aka simple surrogate key
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question