Re: Thoughts on "Love Your Database"

From: Pierre Chevalier Géologue <pierrechevaliergeol(at)free(dot)fr>
To: Szymon Lipiński <mabewlun(at)gmail(dot)com>, Chris Travers <chris(dot)travers(at)gmail(dot)com>
Cc: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>, dandl <david(at)andl(dot)org>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Thoughts on "Love Your Database"
Date: 2016-05-04 14:49:57
Message-ID: 572A0C15.2050104@free.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Le 04/05/2016 13:36, Szymon Lipiński a écrit :
> On 4 May 2016 at 13:13, Chris Travers <chris(dot)travers(at)gmail(dot)com
> <mailto:chris(dot)travers(at)gmail(dot)com>> wrote:
> A few observations
>
> On Wed, May 4, 2016 at 12:31 PM, Geoff Winkless <pgsqladmin(at)geoff(dot)dj
> <mailto:pgsqladmin(at)geoff(dot)dj>> wrote:
>
> On 4 May 2016 at 06:46, dandl <david(at)andl(dot)org
> <mailto:david(at)andl(dot)org>> wrote:
> > I'm a strong believer in putting the business code next to the data, not the wrong
> > side of the object-relational divide. However, for many the challenge of writing and
> > debugging SQL code is just too high!
>
> Your source for this statement please? "For many" sounds rather like
> weasel-words to me. In my experience, a wide range of people, from
> beginners to experts, find SQL easy to write and debug.

Yes, I agree. SQL is just crystal-clear to write, read and understand. I
found out that debugging is usually not a common exercise in SQL,
because the language is so trivial.

...
> From my perspective there is one more thing: when I tried, in couple of
> companies, to move some part of the logic to a database, then usually
> the management said "no, that's not doable, as we will have trouble with
> finding good sql programmers later",

Shocking! Apart from very few languages I know, SQL is by far more
productive and efficient, for many-many tasks.

> and we were still writing all the logic outside the database.

I used to implement the logic outside the database, like you mention,
*but* I was writing plain SQL. Only when I had specific needs, then I
would switch to another language which would just get the results from a
well-polished plain SQL query, process, and feed back things into the
database (with another well-polished SQL, of course) or just throw the
results out somewhere else (file, screen, picture, whatever). No ORM or
any complication.

And I find SQL fairly easy to debug and maintain, no need for fancy
tools: an editor and a console (psql or equivalent) and you're up and going!

Nowadays, things got quite different, and I tend to stuff more and more
logic inside the database. Which is often merely converting SQL queries
into views...

But it comes with a counterpart: the more you put logic inside your
DBMS, the more dependent you become. As far as I'm concerned, I recently
decided to just stick to PostgreSQL forever! (or almost)

À+
Pierre

PS: sorry for the double-reply, Szymon: I forgot *again* to hit
Shift-Ctrl-R instead of Ctrl-R, shame on me...
--
____________________________________________________________________________
Pierre Chevalier
PChGEI: Pierre Chevalier Géologue Et Informaticien
Partenaire DALIBO
Mesté Duran
32100 Condom
Tél+fax : 09 75 27 45 62
06 37 80 33 64
Émail : pierrechevaliergeolCHEZfree.fr
icq# : 10432285
jabber: pierre(dot)chevalier1967(at)jabber(dot)fr
http://pierremariechevalier.free.fr/pierre_chevalier_geologue
____________________________________________________________________________

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pierre Chevalier Géologue 2016-05-04 14:55:15 Re: Thoughts on "Love Your Database"
Previous Message Adrian Klaver 2016-05-04 14:13:04 Re: ruby pg connection fails on centos - okay on debian and dev machine