Re: CMS, foreign keys, and the legacy of MySQL - Mailing list pgsql-advocacy

From Rob Wultsch
Subject Re: CMS, foreign keys, and the legacy of MySQL
Date
Msg-id AANLkTime+vLMCmsq_SjLEEh-=JbD1wc2F5=dRzkPDTTJ@mail.gmail.com
Whole thread Raw
In response to Re: CMS, foreign keys, and the legacy of MySQL  (Josh Berkus <josh@agliodbs.com>)
List pgsql-advocacy
On Thu, Mar 17, 2011 at 11:59 AM, Josh Berkus <josh@agliodbs.com> wrote:
> On 3/17/11 11:52 AM, jj ff wrote:
>> Here's a comment I found while googling around on these issues:  "The
>> problem isn't that InnoDB itself is slow, it's that enforcing foreign
>> key relations is slow. I'm a big fan of referential integrity, but in a
>> CMS it's place is in the application layer, not the data layer."  Why
>> would anyone say that?  What's the point of using a DB if you're not
>> doing to put FKs in it?
>
> Well, they're right ... for InnoDB.  If you're only experience with a
> relational database is MySQL, then you're liable to think that FKs are a
> disaster.
>
> --
>                                  -- Josh Berkus
>                                     PostgreSQL Experts Inc.
>                                     http://www.pgexperts.com
>

There are specific needs for doing things in unorthodox manners. If
the company is surviving by a thread and pulling fk means that the
company does not need to buy a new db server... yeah it may make
sense. Or if you operate in an environment where doing the check in
software is slightly more efficient and slightly more efficient means
saving a truckload of cash.

But yeah, most of the time fk's don't exist are because of ignorance
or lazy ignorance. Don't blame MySQL or InnoDB, they are pretty
awesome for a large set of possible problems.

If in doubt, blame a developer. <- You can quote me on that.


--
Rob Wultsch
wultsch@gmail.com

pgsql-advocacy by date:

Previous
From: damien clochard
Date:
Subject: Re: Proposal for a PostgreSQL Print Magazine
Next
From: Christophe Pettus
Date:
Subject: Re: CMS, foreign keys, and the legacy of MySQL