Re: Why are stored procedures looked on so negatively?

From: Bèrto ëd Sèra <berto(dot)d(dot)sera(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: Some Developer <someukdeveloper(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why are stored procedures looked on so negatively?
Date: 2013-07-24 13:10:40
Message-ID: CAKwGa__ZfVaa4vNWwceqwJW6fpHEOfOTqYz1Z-9yH=zdPsyRQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

> In other words an API in the database.
+1. People code apps and then disappear, because once the development is
over they are not available in the company any more. And each thing you
hardwire in the app becomes a stopper. Meanwhile, every company will have
at least one DBA, who can manage/upgrade stuff in the DB. This is
especially true now that most stuff gets done for phones, and each phone
family needs the same stuff to be redeveloped and maintained over and over
again, with an extremely huge risk of inconsistent behaviours.

Coding in the app is simply not cost-effective.

My 2 p.

Bèrto

On 24 July 2013 01:40, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> wrote:

> On 07/23/2013 05:29 PM, Some Developer wrote:
>
>> I've done quite a bit of reading on stored procedures recently and the
>> consensus seems to be that you shouldn't use them unless you really must.
>>
>> I don't understand this argument. If you implement all of your logic in
>> the application then you need to make a network request to the database
>> server, return the required data from the database to the app server, do
>> the processing and then return the results. A stored procedure is going
>> to be a lot faster than that even if you just take away network latency
>> / transfer time.
>>
>> I'm in the middle of building a database and was going to make extensive
>> use of stored procedures and trigger functions because it makes more
>> sense for the actions to happen at the database layer rather than in the
>> app layer.
>>
>> Should I use them or not?
>>
>
> Personally I figure the arguments for and against are closely correlated
> with where on the development chain you are, and are tied in with job
> security. If you are an app developer than it is in your interest to have
> code in the app, if you are a database developer in the database. Me, I am
> tend to go with your argument about keeping procedures, where appropriate,
> in the database for the reasons you state. In other words an API in the
> database.
>
>
>>
>>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)gmail(dot)com
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-general<http://www.postgresql.org/mailpref/pgsql-general>
>

--
==============================
If Pac-Man had affected us as kids, we'd all be running around in a
darkened room munching pills and listening to repetitive music.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2013-07-24 13:13:14 Re: Why are stored procedures looked on so negatively?
Previous Message Vincenzo Romano 2013-07-24 13:00:34 Re: Why are stored procedures looked on so negatively?