Franck Pachot SQL primary key, surrogate key, composite keys, foreign and JPA
In Java, all objects have an identity from their memory address. When persisting them, a key is required. And this is where religious wars Natural key Composite key Surrogate key Sequence or UUID Let s see what they are. Their pros and cons, for a wise decision, per usecase. The tradeoffs, for performance, agility, scalability, JPA, or other framework support. In the modern world of microservices and distributed databases.
|
|