in reply to Creating a model of a bad database

I have the same issue with a set of sites I inherited, so I'm anxious to see what the other Monks have to say about this. One thing I have been contemplating is moving from MySQL to PostgreSQL, modeling the database correctly, then using updateable views to mimic the old database structure. I'm not suggesting that as a course of action for you, but wouldn't mind a few comments on this approach from other Monks. I'm also contemplating ORM as a solution.

Replies are listed 'Best First'.
Re^2: Creating a model of a bad database
by roboticus (Chancellor) on Dec 12, 2006 at 23:42 UTC
    Cabrion:

    I've done the same technique a few times. I used Sybase for one, and MS SQL for another. It's a very nice technique. I also like to remove permissions from the underlying objects where possible. Then, every time I get to modify one of the client apps, I fix 'em, and try removing more permissions & such.

    The only problem with such an incremental approach is that you often don't finish. (I've got one in a rather odd state right now.) Then if you have to turn over the project to someone else, they may be confused by it. Hopefully, they have a well-developed sense of "taste" and will continue the migration towards a rational end.

    On my last project, I was the fourth person to work on it. You could plainly see that each one had their own philosophy. I didn't want a fifth philosophy in the code, so I just adopted the one that the majority of the code used. As for the database, it was just a bunch of tables. No relationships at all! Needless to say, I started tying things together in there. Another release or two, and at least the database will be in good shape. (Heaven help the code, though....)

    --roboticus