Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

davorg (18)

davorg
  dave@dave.org.uk
http://dave.org.uk/
Yahoo! ID: daveorguk (Add User, Send Message)

Hacker, author, trainer

Technorati Profile [technorati.com]

Journal of davorg (18)

Friday April 02, 2004
11:12 AM

Database "Design"

[ #18176 ]

The web is supposed to be this great leveller. Everyone is able to publish whatever they want and put it before a global audience. There is no bar to entry into the web club. Sometimes that might not be seen as a feature.

We all know HTML "designers" who have no idea of how HTML should work.

As Perl programmers, we've all seen CGI programs written by "programmers" who have no idea how to program.

I'm now starting to see more and more web sites that include databases which have been "designed" by someone with absolutely no clue about entities and relationships.

Take, for example, the database that I'm currently replacing. It's a music database so it models (amongst other things) artists and tracks. An artist has a number of associated tracks.

In my design, there is a table called "artist" and a table called "track". The artist table has a primary key and the track table has a column called "artist" which contains the key of the artist associated with that track.

In the original database[1] there was a table called artist. The track data was an attribute of the artist. And when I say "attribute" I mean that there was a column in the artist table called "track" which contained a comma separated list of the tracks associated with that artist.

But it gets worse. A track has attributes - the track name, the name of the MP3 file it is stored in and a boolean flag to indicate whether it has been approved by the A&R people. So the artist table needs three columns for the track-based data. The "track" column I mentioned before contains the filename. There are also columns called "track_name" and "track_approved". Each of them are comma separated lists of values.

And in some cases, the number of items in the three lists isn't the same.

This is a web-based system that was designed and implemented by another company for my current clients. People are being paid to design systems as badly as this.

Am I being too critical? I've been working with databases for far longer than I've been working with the web or Perl. Database normalisation is second nature to me. Is it too much to ask that people who are designing databases actually know something about... er... designing databases?

[1] Which was in Microsoft Access, but I'm not drawing any conclusions about the abilities of Microsoft users in general.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • You're not being too critical. I expect to see such sloppy work out of CS students or new programmers, but it should never work it's way into the professional code.

    Now that's what I think. The reality is, I have funny notions about software design. I think that professional software should have a test suite, preferably one that can also run on the end-users system. Many would argue that point with me. Few would argue that a test suite is a bad idea, but many might argue that it's not necessary ("I do

    • A nice Louisville Slugger always helps.

    • Now that's what I think. The reality is, I have funny notions about software design. I think that professional software should have a test suite

      Test suites are not part of the "culture" everywhere. It appears to be a language-thing. Perl (as do other languages) come with frameworks to write tests. For other languages there appears to be no such standard. I've hardly ever seen a C library coming with a test suite. And the remarkable thing is: Most often they work splendidly. Maybe it's because a good C pro
    • Sorry but any IT gradudate should know normalisation. There is no excuse - any IT degree that doesn't cover the basics of normalisation (its not that hard, in fact once you've done a handful of exersizes you realize its pretty much common sense) is worthless.

      As for new programmers - again any course which teaches programming has to include some database design - name a single application since 1980 that didn't use some sort of database.

      --

      @JAPH = qw(Hacker Perl Another Just);
      print reverse @JAPH;
      • Sorry but any IT gradudate should know normalisation. There is no excuse - any IT degree that doesn't cover the basics of normalisation (its not that hard, in fact once you've done a handful of exersizes you realize its pretty much common sense) is worthless.
        I don't think I said anything about these people being graduates. I don't know for sure, but there seems to be no evidence to support that.
        • I know. The reply I replied to mentioned Graduates not knowing Normalisation which is pretty shocking.

          mind you I have worked with graduates who it seemed forgot how to normalise databases. (i.e. they did it in wierd quirky ways to work better with VB or just used too many or too few tables).

          --

          @JAPH = qw(Hacker Perl Another Just);
          print reverse @JAPH;
      • name a single application since 1980 that didn't use some sort of database.

        mysql <gd&r>

  • Easy-to-use tools (e.g., Access) and the ready availability of books and articles has lowered the starting bar for doing database work, but many of the intro books--at least the ones that I've paged through--seldom give explicit guidance for distinguishing good relational designs from bad ones. The more serious books do, but these aren't often the ones people find on the bookstore shelves when they have a problem to solve, but no background in theory to guide them. And once they have something working, most