Thoughts from a Coding Mommy

Tuesday, October 24, 2006

You know you're a geek when...

You and your coworkers are snickering in the aisles and giving each other high-fives because you think Oracle sequences are cool. Yeah, I know, what could possibly be cool about that?

In the world of modeling data and tables schemas, data integrity is about as cool as you can get. Unique constraints and foreign keys, mmmmm....all yummy stuff. Keeps the data in line (as in toe the line). It also means that you are letting your database do the work (or atleast share the responsibility) of data integrity. Sure you could do it all in the application, but shouldn't you harness the power of the database and let what databases do what they do well and programmers can work on something the db can't provide?

Dunno. I think it seems obvious but then nothing surprises me anymore. And sure, there may be good reasons to not let the db provide the id column on a table, but I'm not sure that when I come across this in practise someone has actually provided me with some sort of compelling explanation. Actually, I take that back. I have come across reasons not to create a foreign key constraint but I've always let the db create the id column on my behalf. Sure I might use surrogate keys but for true identity and uniqueness, give me a db sequence any day.

0 Comments:

Post a Comment

<< Home