Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Architecture design for full stack development.

by erix (Prior)
on Jun 24, 2017 at 05:41 UTC ( [id://1193430]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Architecture design for full stack development.
in thread Architecture design for full stack development.

The “primary key” of any and every(!) table within your database should be a perfectly-arbitrary, yet guaranteed-unique, “identifier ... and nothing more™ ...” of a particular row. All such values should be entirely internal to the database, and never exposed to, therefore also never of material interest to, the outside world.

This touches on the general question on whether or not to use Natural Keys [1]. Apparently you think one should not use natural keys. You think surrogate keys are always necessary.

That's fine, but it certainly isn't received wisdom. It is an open question: many people will argue that natural keys have important advantages [2]. I will always use natural keys where possible.

[1] https://en.wikipedia.org/wiki/Natural_key

[2] http://www.databasesoup.com/2015/03/primary-keyvil-reprised.html

Replies are listed 'Best First'.
Re^5: Architecture design for full stack development.
by chacham (Prior) on Jun 24, 2017 at 19:29 UTC

    Nice post. That covers it at a high level pretty well. Thank you.

    it certainly isn't received wisdom.

    Not only that, i think most people who do that, do so out of sheer ignorance. When i ask them for the reasons, they repeat non-trueisms about how the RDBMS does things.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1193430]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 13:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found