Legitimate Uses of the Antipattern
Some object-relational frameworks simplify development by assuming convention over configuration. They expect every table to define its primary key in the same way: as an integer pseudokey column named id. If you use such a framework, you may want to conform to its conventions, because this gives you access to other desirable features of the framework.
There’s also nothing wrong with using a pseudokey, or assigning values from an auto-incrementing integer mechanism. But not every table really needs a pseudokey, and it’s not necessary to name every pseudokey id.
A pseudokey is a good choice as a surrogate for a natural key that’s too long to be practical. For example, for a table that records attributes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access