Comment On Proper Database Nondesign

I'll leave it to Kevin E. Ford to describe today's WTF: [expand full text]
« PrevPage 1Next »

re: Proper Database Nondesign

2004-09-15 15:03 • by Crash
Ahhh.... but with everything in the same table.... lookups are FAST!

re: Proper Database Nondesign

2004-09-15 15:17 • by Chris R. Timmons
I've seen others on this blog defending some of the WTF code posted here, so I thought I'd jump in and and try to sound optimistic:

1. The teenager who designed the database was too distracted thinking about his junior prom to learn about normalization and referential integrity.

2. The database design team consisted of a thousand monkeys banging away at a thousand computer keyboards, and this is what they came up with.

3. Can you say "reefer madness"?

I'm sorry. That's as optimistic as I could get about this database...

re: Proper Database Nondesign

2004-09-15 15:27 • by Peter
At a previous company I worked for, we used Clientele as the CRM app. It used a very very similar key structure, and used UUID/GUIDs for the keys. Person/Group/Organization (or PGO) instead of Co/Div/Dept. Instead of nulls, they used 0, yep zero. So Dr Bob, who works at both DowntownHospital and SuburbanClinic could not be the same Dr Bob, since the G or O would be a different GUID. Since the back end database could be access, sql server, oracle, or any odbc compliant database, there was no referential integrity at the db level, it was all in the code.

I did not have your luxury of dismissing the product, I had to make it work. And I had to make it work seemlessly with the rest of the company's databases. That was a challenge, reverse engineering the way stuff was organized. I remember being very impressed with how they managed to lock up the access databases (which was the front end) with encryption and workgroup security. I was also very impressed that they could do what they did with access. Note, the company I worked for at that time did *everything* with access.

If you had poked stuff into the supplied front end, you might find 0 instead nulls. But you are correct in noticing it is not a clean design.

I've seen worse, don't make me come up there carrying my cow, uphill, both ways, in the snow, with my hand carved "1"s and hit you with my oxygen bottle to prove it. Please. ;)

re: Proper Database Nondesign

2004-09-16 05:34 • by DrPizza
Maybe they designed one table and then got bored and just copied the design for the other tables.

re: Proper Database Nondesign

2004-09-16 05:46 • by KoFFiE
@Peter - seriously - if you've seen worse YOU HAVE TO POST IT!!!

Damn...

re: Proper Database Nondesign

2004-09-16 06:37 • by MGC
* * * ******* ******
* * * * *
* * * * ****
* * * * *
* * * * *
***** * *

re: Proper Database Nondesign

2004-09-16 06:41 • by MGC
*--*--*--*******--******
*--*--*-----*-----*-----
*--*--*-----*-----****--
*--*--*-----*-----*-----
*--*--*-----*-----*-----
-*****------*-----*-----

Don't be fooled!

2004-09-16 07:08 • by icelava
It's really just a RAIT - Redundant Array of Inexpensive Tables :)

re: Proper Database Nondesign

2004-09-16 07:56 • by Tom
Oooh. I used to have to mess about with the back end of Clientele at my last place to create bespoke reports and the like. An unmitigated bunch of @rse if I remember correctly, and made my life a nightmare for much longer than I would have liked.

re: Proper Database Nondesign

2004-09-16 08:20 • by Cakkie
I really do wonder how there join statements look like :p

SELECT * FROM Companies c
INNER JOIN Devisions dv ON c.CompanyID = dv.CompanyID AND c.DevisionID = dv.DevisionID AND c.DepartmentID = dv.DepartmentID
INNER JOIN Departments dp ON c.CompanyID = dp.CompanyID AND c.DevisionID = dp.DevisionID AND c.DepartmentID = dp.DepartmentID

-or judging by the structure they probably never heard of JOINS, en do the linking on the oldfashioned way, in the WHERE clause

SELECT * FROM Companies c, Devisions dv, Departments dp
WHERE c.CompanyID = dv.CompanyID
AND c.DevisionID = dv.DivisionID
AND c.DepartmentID = dv.DepartmentID
AND c.CompanyID = dp.CompanyID
AND c.DevisionID = dp.DivisionID
AND c.DepartmentID = dp.DepartmentID
-- If ReallyStupid = True, even add more :p
AND dv.CompanyID = dp.CompanyID
AND dv.DevisionID = dp.DivisionID
AND dv.DepartmentID = dp.DepartmentID

re: Proper Database Nondesign

2004-09-16 09:52 • by Steve O.
Icelava - Wouldn't that actually be Redundant Array of Inefficient Tables?

re: Proper Database Nondesign

2004-09-16 14:38 • by Randy Glenn
I believe that would be a Redolent Array of Idiotic Tables.

Redundant Array of Independent Tables also applies, with the lack of Referential Integrity constraints.

re: Proper Database Nondesign

2004-09-17 15:13 • by Vik
I've seen some large ERP's (an older version of Great Plains, for one) also not use referential integrity. However, I think this has more to do with avoiding the overhead associated with integrity checking in high volume OLTP environments.

Plus, all access to base tables is more or less controlled through sprocs, so I could see some reason NOT to use it, though maintenance and debugging would certainly suck.

However, buddy there should really read up on normalization techniques.

As for queries against this table, I've seen a similar structure using a bunch of ugly joins, a la Cakkie's eye glazer above, combined with a series of uglier UNION's.

Yeargh...

re: Proper Database Nondesign

2004-09-28 06:29 • by DesperatelySeekingAnotherJob
Count yourselves lucky... I'm still supporting a Clientele system... heavily bespoked... and the bespoked code is even worse...

It's being replaced... By a web system developed by the same company... Have they learned anything at all? What do you think... How many of you have seen stored procedures that not only generate HTML, but JavaScript too?

HELP ME SOMEBODY!!!!!

re: Proper Database Nondesign

2004-09-28 06:31 • by Collegue
Transactional HTML and Jscript... bleeding... edge.
« PrevPage 1Next »

Add Comment