- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
id comment 6 'Frist"
Admin
They need Control but they have Chaos.
Admin
I've noticed that generally DBAs are over protective. They're extremely paranoid people that are afraid to relinquish any bit of control to anyone other than themselves. And organizations tend to be extremely paranoid as well, fearing anything that might let someone WHOM THEY HIRED do something that isn't specifically detailed in some manifest somewhere. This also tends to lead to nonsense like tracking each and every specific change that someone does, to the extent of even tracking when someone views a record, because they're so paranoid that somebody might change something instead of oh I don't know, trusting people they employ.
it's not always large companies, either. I've seen an increasing amount of smaller organizations trying to pull the same rigid control like everyone else. The only thing I can think of its that they are run by old fuddy-duddys that are out of touch with the world since the last time they actually worked in an organization before making their own, so they keep the old outdated practices that were in place that they remember and are afraid to evolve.
Admin
The end of the story makes no sense. They've got a table of hobbies. They create a new table of hobbies. Then they use the original table of hobbies.
The only difference between that and Luigi's proposal is the many-to-many relationship. With the DBA's (existing) set-up, there's only one hobby per client.
The DBA's final remark about not having to add a foreign key is a non-sequiter, as he's already got the foreign key.
Admin
Control, Control, Control, and not a single employee named Max.
Such a disappointment.
Admin
Is it by mere coincidence that the image has a green theme, when the name of mr. protagonist is Luigi?
Admin
Luigi's solution was mad. This should be a free-text field with a pre-defined list of common values.
Admin
One of the best-kept secrets in IT is that any moderately competent developer, armed with a few Oracle books (or SQLServer, or whatever) and a modicum of common sense, will run rings around 98% of self-styled "DBAs" out there.
Admin
Quite true. Something like hobbies which can be anything and everything, doesn't need some kind of corresponding lookup table, it needs the ability to enter anything with some kind of "smart" dropdown (like Google search) that prefills possibilities as you type it.
Admin
Not quite.. Let me explain. It may look like a ManyToOne but that is only a mask to a hidden ManyToMany. Take the following:
Customer:
Hobby List:
They basically put multiple values in 1 line in a ManyToOne relationship.
The downside of course is that not only there will be a problem when there is a value with a
+
in it (small chance but still). But it is also hell for the code to maintain this list when the singular list of hobbies needs to update. You need to analyze the hobby table, split em all, check all combinations, update as needed, that code is hellish..TRWFT is simply that, cover a ManyToMany relationship as a ManyToOne to prevent some sort of foreign key and an extra table, which they regard as more control.. You can't call them exactly smart.. but this way no matter what with all the double checking you do have all the full control (and wtfyness) over the hobby table!
Admin
Bullshit, they'll make everything a string and ignore constraints entirely because it works better with their shitty ORM.
Admin
'snot what it says
Admin
Admin
I think the wtf there is that they changed the field to a string type. Obviously there is at least a perceived need by Luigi to have more than one hobby associated with a customer. The DBA's schema does not allow this but by using a string instead Luigi's application can look up the hobby and append it. Basically they took a M:N relationship that needed to be M:M, and rather than implementing Luigi's correct solution they have instead decided to go with what will be a multivalued field.
Admin
TRWTF is - the plural of hobby is hobbies, not hobbyies.
#pedantry
Admin
int_id str_hobbyies
1 fishing
2 photography
3 dancing + photography
4 climbing
5 climbing + fishing + photography
6 FileNotFound
7 Writing C++ code
Admin
Power sets to the rescue! Although I'm slightly disappointed that he didn't make a table with all permutations as well.
Admin
A free text field for the hobbies of a customer is probably the most accurate solution for even the most exotic diversions, but not really good if you need to find all customers that share a common hobby; because a clerk entering data might consider the suggested "photography" is not accurate enough and write e.g. "photo art" instead, so when searching for all customers interested in "photography" (e.g. to promote a new camera), this one isn't found.
Admin
Maybe if enough of you say it, then it will penetrate the alcohol.
OK, yeah. He did say that.
Sort of.
Admin
Luigi should have implemented it as a foreign key bitfield
Admin
Me think that the DBA is unable to come with a SQL statement to concat the hobbies of a join to return a single line per customer.
Yet another DBA educated in Excel.
Admin
Yes for smallish solutions this is true. If we are talking about some backwater eCommerce shop that measures annual revenues in millions you will come to this conclusion.
Try taking the solution they implement and getting to scale to something an F2000 needs and you will be in a world of hurt. There are lots of bad DBA's out there but there are also lots of really good ones whose narrow focus allows them to spend develop a depth of knowledge that lets them really tease performance out of a database engine, some developer with an book open in his lap is never going to achieve.
I once worked in shop where SOP was application developers write their own stored procedures their application needs and the the DBA rewrite them and hand them back. I was doing pretty esoteric stuff at the time so I never got to many changes sent back, but once and while I would get sent back some really clever ( but well commented ) PL/SQL sugar that really would run 10% faster in test. It was stuff I would not have come up with without eating, sleeping, and breathing PL/SQL for weeks.
Admin
Maybe I'm looking for a sense where there's none, but the hobby_ids table looks suspiciously like an "expanded bitfield" - if we accept that the table is anonymized and originally looked like this:
Then it looks like every single hobby has a "round" binary value:
Then all combination makes perfect sense:
Well.. SOME sense.. certainly not "DBA" sense..
Admin
I suppose you work with PHP "developers". He did say "moderately competent developer", see?
"Everything a string" makes no sense with any typed language, and especially so with a ORM with validation turned on.
Good DBA is a precious thing for developers too - devs should not know about the implementation issues with the DB, just understand the proper design patterns for the data & query language, and let the administrators work out the clustering, backups, fault tolerance.
In this case the fault IS the DBA and the dev just needs to tolerate him until the contract finishes :)
Admin
Admin
Overall, "hobbies" are one of those things that has real potential for marketing purposes, but which computers are really bad at establishing usably AND accurately without human intervention.
(1) Consider the hypothetical hobby-word "Music". What does this mean? Listening to music? Going to concerts? What sort of concerts? What genre(s) of music? Playing music? Which instrument(s)? etc.
(2) You can mitigate the freeness of the field by providing suggestions from a pool of previous values that narrows as you type, as found on many search-related web sites (Goggle/Bong/etc., but also Wikipedia are good examples).
(3) At least four, in my case, more if you consider acoustic and electric guitars to be sufficiently different.
(4) The current project relates to what amounts to mythology rather than history, a bunch of stuff around the tale of Havelok.
Admin
Well, I'm a developer -- have been for umpteen years. In my experience as a contractor in most of the places I;ve gone, the job "DBA" meant a person that can add/drop databases, set backup schedules, etc. The "database design" was done by developers. Developers also did the stored procs, views, etc.
I have contracted at some very small places (< 30 employees in the company) and some very large places (> 14000 employees world-wide). In most cases I had the most trouble with DBAs not knowing what was going on when those DBAs were Microsoft Certified. Seems they spent too much time on studying the Microsoft answers for the test.
Again, that's not saying ALL MS Certified -- or even ALL DBAs are the same. I have only worked at 10-12 companies as a contractor.
Oracle DBAs, OTOH seem to always have it going on!
Admin
Admin
Admin
Just make a table function that loops the offending table and splits on the ' + ' and returns a proper result set. You're a smart person aren't you?
Admin
I hate you for making me relive this.
Worked on a system a few years ago where they eschewed a many to many relation ship with this technique. Except it was a string that looked like "YYYNNYNYYNNNYNYYYNYNYYNYYYYNNNNNNNNNNNN"
Admin
"the new customer/hobby relationship to be a many-to-many relationship"
Should be "many-to-many correspondence from customer to hobby". Specifically, 'correspondence' rather than 'relationship' and (see http://en.wikipedia.org/wiki/Correspondence_(mathematics) which has a direction. Avoid the term 'relationship' as regards relational technology: folks get start referring to the types involved in a 'relationship' as being 'relations', leading to further confusion that the relations in relational database theory are something to do with such 'relationships'.
Admin
Admin
Stories like this is one of many reasons why I only lasted a short while in the corporate world; control and red-tape.
The problem with so called "Clever" developers is that they come up with "clever" solutions that not only solve all current problems but all future imaginary problems too!
However these "clever" solutions become a maintenance nightmare as no one can understand how it works and they eventually end up on this website.
Whereas actual clever developers understand that the idea is to come up with simple, clear and concise solutions to the problem at hand and then refactor in the future when needed. Code that is clear and easy to understand is worth it weight in gold. (assuming code has mass and there is gravity...)
Admin
Admin
The thing with Database schemas, is that once you make a designchoice you're stuck with it.
Every insert query would have been broken by the change to the schema.
So, while it looks dirty, this is a workaround that at least doesn't break other stuff.
Admin
Because DBAs shouldn't be developing, designing, or architecting programming solutions. They should be administering databases, tuning queries and indexes, monitoring storage and assisting devs where necessary. I'd much sooner hire a DBA who knows the ins and outs of SQL backup than one who (thinks he) knows the finer points of a join statement.
Admin
How does one tune a query if one doesn't know the finer points of a join statement?
I've seen far too many really dumb things done by developers almost anywhere, so I know a DBA has to be involved in the design and architecture of the database side.
(it's mostly scaling problems - people don't test on large enough data sets to discover how badly their SQL will perform when it hits our production DBs)
Admin
Admin
How much you want to bet it is a one-to-one now, Hobby ID is matched to customer ID. Basically they added a comment field to every record.
Admin
What kind of lousy DBA is this that he/she does not even know about the XML datatype? Amatuer.
Admin
It's also just possible that Mr. Martinet was fed a line of bullshit and the DBA isn't really smart.
Reminds me of the system our genius DBA set up. It associates stored procedures with an entity. Those procedures are then run to calculate data for that entity.
The DBA set the whole system up to key off of the entity's name field instead of its unique id and made the argument that was "just a philosophical choice because either value could change."
While I suppose it's technically true that the value in the column defined as an int identity could change, only one of those columns has an interface in the application to be administered.
Surprisingly, it's not the unique id column. Of course, practically the first thing that happened is somebody changed the name of the entity and the calculations didn't update.
Admin
They tried calling the column str_hobby's but for some reason they started getting funny results from their queries..
Admin
Admin
The application I maintain as part of a franchise does this for security roles.
We currently have 30 roles on a 32 bit signed int. One of the remaining bits might cause holy havoc if used; the other is the sign bit.
Admin
But what does the Book of Five Rings say about this database design?
Admin
Admin
I wonder how long it would take for someone to hard code a hobby combination into the application with this method.
Admin