Dynamic Database Schema [closed]

What you are proposing is not new. Plenty of people have tried it… most have found that they chase “infinite” flexibility and instead end up with much, much less than that. It’s the “roach motel” of database designs — data goes in, but it’s almost impossible to get it out. Try and conceptualize writing the code for ANY sort of constraint and you’ll see what I mean.

The end result typically is a system that is MUCH more difficult to debug, maintain, and full of data consistency problems. This is not always the case, but more often than not, that is how it ends up. Mostly because the programmer(s) don’t see this train wreck coming and fail to defensively code against it. Also, often ends up the case that the “infinite” flexibility really isn’t that necessary; it’s a very bad “smell” when the dev team gets a spec that says “Gosh I have no clue what sort of data they are going to put here, so let ’em put WHATEVER”… and the end users are just fine having pre-defined attribute types that they can use (code up a generic phone #, and let them create any # of them — this is trivial in a nicely normalized system and maintains flexibility and integrity!)

If you have a very good development team and are intimately aware of the problems you’ll have to overcome with this design, you can successfully code up a well designed, not terribly buggy system. Most of the time.

Why start out with the odds stacked so much against you, though?

Don’t believe me? Google “One True Lookup Table” or “single table design”. Some good results:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:10678084117056

http://thedailywtf.com/Comments/Tom_Kyte_on_The_Ultimate_Extensibility.aspx?pg=3

http://www.dbazine.com/ofinterest/oi-articles/celko22

http://thedailywtf.com/Comments/The_Inner-Platform_Effect.aspx?pg=2

Leave a Comment