/    Sign up×
Community /Pin to ProfileBookmark

When does SQL database normalization become “stupid”?

I was recently in a heated discussion with my boss about a form I was building where the user ties an amount value to a “thing” (let’s call it a teapot), but he wanted the teapot field to be text whereas I thought it should be a drop-down with the names and IDs of the existing teapots… the user wasn’t allowed to create new teapot there, just assign an additional value for a new feature (which would be in its own table).

When I mentioned that if the user just types in the name of the existing teapot (whether they remembered it exactly or not or made a typo), and if someone else changes the name of the teapot (as has happened before, completely legitimately), the saved amount value record would be dereferenced from the teapot record, and then not applied during checkout… I said if I stored the key instead, changing the name would keep the reference.

He got upset and said that the value record will actually tie to another table record where just the teapot name is stored… which of course would suffer from the same dereferencing issue. I was told the references should be “normalized” through the unique auto-incrementing unchangeable IDs values, but he said “over-normalization is stupid”, and that “too many JOINs slows down the database”.

So I’m a bit exhasperated, and venting a little. Is this really stupid over-normalization, and when is assigning “foreign” keys by changeable name a good idea?

to post a comment

3 Comments(s)

Copy linkTweet thisAlerts:
@NachfolgerApr 07.2020 — This isn't stupid, and a completely legitimate approach to the issue.

However, your boss is... your boss.
Copy linkTweet thisAlerts:
@NogDogApr 07.2020 — Not knowing all the details, it's hard to say for sure, but modern relational databases are pretty frickin' fast dealing with joins, as long as things are indexed optimally.

Anyway, would it make sense to use a [u][HTML data list](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist)[/u] as a compromise?
Copy linkTweet thisAlerts:
@DanielwonderApr 07.2020 — __(Message deleted by moderator. Please do not hijack other people's threads with unrelated questions. Start your own thread, instead.)__
×

Success!

Help @webdevdave spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.27,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...