?

Log in

No account? Create an account

The One True Relational Database Model

« previous entry | next entry »
Aug. 12th, 2004 | 07:47 pm
mood: amusedamused
music: Tom "T-Bone" Stankus - Existential Blues

Microsoft has a relational database on the front burner for a future version of Windows. Personally, I think they're barking up the wrong tree. If they spent more time building websites they'd know that hierarchical models with very tight scripting connections offer more performance and a higher level application model. Relational databases are good for factories and stores. Object databases map the model of the Web. Just change the slashes to dots and off you go. - scripting.com

Heirarchical databases and Object databases are arguably subsets of Relational databases. If you think your programming effort needs a 'higher level application model', you should go ahead and use one -- built on top of a relational database. If you have some data that you need to manage professionally, you need the structure and reinforcement that only the relational model can provide. If that means you need to pay me to build you one, then so be it.

If there's a better model than the Relational one out there, I want it caught and shot now to hear about it. Maybe what I mean isn't better model, it's better formalism. Sure, use a flat text file to manage your data. That's better for some projects, some purposes. But it will catch up with you (or better yet, someone else) as the project ages. (For your own sake, recognize when that starts to happen, and re-engineer the project.)

If you go through the excercise of designing a relational database for your data, the nicest thing is, your data will stay that way! almost self-organizing, and it's easy to discover new uses (new ways to use your old data)!

Heirarchical databases collapse under their own inflexibility.

Object databases look pretty but tempt you into omitting some relations that you later have to back-fill using "business rules".

Link | Leave a comment |

Comments {26}

Triple Entendre

Re: the pure thingness of the things

from: triple_entendre
date: Aug. 13th, 2004 10:44 am (UTC)
Link

If you're allowing yourself to engage in projects that don't include a design phase as the very first... then you and the client both get what you deserve. Might as well go home at 5pm and keep YOUR sanity, the ship dates will slip regardless....

Relational databases *could* store things in a physically collocated structure

They're called indexes, and they can be and often are physical. In MSSQL tables there's always at least one. An index can encompass one or many fields. If you happen to know the best clustered index for your purpose, you can tell it so, and that's how it will be stored physically on the disk. But a well-designed schema usually will be fast enough that you don't need to second-guess the database engine; it works hard so you don't have to. Modern RDBMSes do a very good job of optimising -- unless you try to use them as big, black, featureless boxes. Understand your tools.

(typically done by select into), but they don't be default (scaling is typically done by caching where this does happen) because that would defeat the purpose for them in being flexible ad hoc queries.

There's almost never a reason to 'select into' in a data-driven database application. You might be thinking of data warehousing, a monstrous denormalization process which has its own misguided flavors of wrongness, but a few specific appropriate uses. Reporting of historical corporate financial data, for example.

You've not addressed the OO to relational mapping headaches this alone in enough for me.

Those incipient headaches probably indicate things that don't need doing! If your specifications mandate the use of a particular OODB tool, or if for whatever reason you have to do things a certain way, then sure, that's a problem. Not one that would stop me, but that's because I've been mapping things across systems for a decade now, and I don't find it achy.

If I can tell you anything, it is this; you are almost certainly doing one of two things:

1) doing extra design work in order to solve problems that have already been solved by RDBMSes and relational theory
OR
2) not doing that design work (which would have been implicit and easy, perhaps even automated, if relational theory were applied) and doing extra work coding around the problems that result, probably late at night and weekends.

Part of the motivation for all my work is to save people from unnecessary effort.

Solved problems. These are solved problems, I swear it.

Rhetorical:
Why is it that every three to five years we invent some new technology that could be really great, except the designers don't carry over any of what was learned before? "But this one goes up to eleven?"

-Trip

p.s. I'm not editing these much, in the interest of being comprehensive and responsive. I hope that this is useful.

p.p.s. Despite what one might think from my tone, my experience is wholly practical, not academic. at all.

p.p.p.s. On quick rereading this sounds pretty ranty and harsh at you all personal. S'all love, I promise.

Reply | Parent | Thread

DeepTape

Re: the pure thingness of the things

from: deeptape
date: Aug. 13th, 2004 11:07 am (UTC)
Link

Sounds like you guys are talking apples and oranges.

Trip, where did you get the idea troyworks didn't do any design work up front?

Sounds like Troy is complaining about the evil of SQL, the poor match of data types in the object space to data types in the traditional relational space, and the effort required to hack them together.

Reply | Parent | Thread

Triple Entendre

the pure appleness of the oranges

from: triple_entendre
date: Aug. 13th, 2004 12:00 pm (UTC)
Link

That's just me not editing. When I'm talking like this and I say "you", I mostly mean "that straw man standing next to you".

I did say that it was a rant, which is asking forgiveness in advance, but even then I'm usually better at editing out my rhetorical abuses of fallacy. I apologize for any confusion to the readers and to troyworks.

Troyworks is very experienced and, I am sure, talented at application development using oranges. But he was dissin' on them apples!

Reply | Parent | Thread

TroyToy

Re: the pure thingness of the things

from: troyworks
date: Aug. 13th, 2004 12:24 pm (UTC)
Link

First this is my own project so I'm not driven by any requests other than to do what I think is the best: less code = faster development, less maintenance, oodb's = faster runtime performance.

1) doing extra design work in order to solve problems that have already been solved by RDBMSes and relational theory

nope less design work overall, I store things as objects, if needed I query things like objects collections, the database does the heavy lifting. If i want set like operations for ad hoc like queries (mimicking join operations) I use a persistent data structure that's appropriate for things like that. Normally in a correctly designed model, everything is done via navigation (think of pointer references on a massive virtual memory space).

2) not doing that design work (which would have been implicit and easy, perhaps even automated,

Nope again. I model objects that represent my problem domain, postprocess them (and automated process to make them persistence capable) and they are the same objects I retrieve from the database, with relations perserved. I model once, not twice. -the data aspects of my Class Heirarchy IS the database schema.

Normalization isn't a catch all, give me 50 users with 1 phone number (single table), and 15 with 10 (two tables with cost of join), it becomes hard to make a model with works for everyone in an optimal fashion.

RDMBS's are built ontop of code..just like middlewear, which all are built onto standard data structures, and these are accessilbe inside the database and not, so I'm not recreating the wheel.

I think we may be arguing tools for different purposes.

How many tiers are your application? HTML with SQL embedded?
How frequenty is the same data accessed together, e.g. customer, contact info.

If your saying RDBM's aren't faithful representations, and relational theory isn't availalbe in other forms of code, I guess I don't understand what you mean by the term. Got some links?

OODB's are NOT new just most people don't understand them very well. They are used for MASSIVE databases (stanford particle accelerator) with astounding transactions (stock market, telecommunications)..who could all use Oracle if they wanted to, but don't for a reason, it doesn't work. If we are talking about any other site (say live journal) it's possible to go either way with different tradeoffs.

ps1: just the way I like it, and indeed it's useful, even if I don't think we are seeing eye to eye.
ps2: likewise.
p23: likewise.

Reply | Parent | Thread