Home > Databases, Software design > Why foreign keys are important

Why foreign keys are important

On one project, about two years ago, we have decided that we didn’t need relations in relational database.

So we deleted them. We just used tables for storage, almost like flat files.

At first, programming was easy, but then, we started implementing logic for relational integrity, and that was no easy task. We had to implement every “relation” manually in code…

After a while, we started using relations again. Relations are there for a reason. Sometimes it’s a pain in the neck to deal with them. But, it’s even worse without them.

In relational databases, just use relations. Many smart people have figured that out. Smarter than me, that’s for sure.

P.S. document databases also have some kind of “nesting” relations built-in.

Advertisements
Categories: Databases, Software design
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: