Re: When to choose putting logic into PL/pgSQL and when to use an app server

Поиск
Список
Период
Сортировка
От Rory Campbell-Lange
Тема Re: When to choose putting logic into PL/pgSQL and when to use an app server
Дата
Msg-id 20120310164501.GC17838@campbell-lange.net
обсуждение исходный текст
Ответ на When to choose putting logic into PL/pgSQL and when to use an app server  (Frank Lanitz <frank@frank.uvena.de>)
Ответы Re: When to choose putting logic into PL/pgSQL and when to use an app server  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Список pgsql-novice
On 10/03/12, Frank Lanitz (frank@frank.uvena.de) wrote:
> I started to get into PL/pgSQL a bit as I'm started to work at an
> application where I might can make usage of it. But I'm not sure even
> those I read a bunch of documentation where is it useful to put logic
> into database server and when I shall do the computing inside an
> application layer... Does anyone of you have some kind of rule of a
> thumb about that?

It might depend on what sort of logic you are referring to. Some web
frameworks provide very simple ways of persisting objects to the
database and then querying these which are fine for many applications.

If your data model requires good quality data and you are making heavy
use of the relational aspects of the database, plpgsql can be an
excellent choice.

Wherever you do the bulk of the data "logic" you will no doubt be doing
some work in SQL even if you are using an Object-Relational Mapper
(ORM), or in the middleware language even if you are using plpgsql.
Things like web forms are best validated in the middleware.

From our experience we have altered our web frontend and middleware
several times over the last 7 years while running much the same plpgsql
functions. We are very happy with this arrangement.

Rory

--
Rory Campbell-Lange
rory@campbell-lange.net

Campbell-Lange Workshop
www.campbell-lange.net
0207 6311 555
3 Tottenham Street London W1T 2AF
Registered in England No. 04551928

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: float to numeric(7,3)
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: When to choose putting logic into PL/pgSQL and when to use an app server