Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-13 Thread c k
Yes, I know that I can not create a simple web application using only
postgresql because we need a web server to server the html content. I not
going to add web server functionalities to postgresql, but just want to use
existing  features. I would like to generate content dynamically. I want
minimum developers to be required, simple and powerful security and
administration, and most importantly ability to respond to changes.
As s...@bestmx.ru replied above, I want to go through this way at least to
test the application. What I am going to do is
use python for a simple test web server.
Use xml to define static content for each page.
Use posgtresql to generate dynamic content using stored procs.
static content of the page and dynamic content both will make final web
page.
Use javascript for client UI.

For my application the most important part is generating dynamic content.
Scaling, concurrency etc are not the issues at this time. We have to adopt
govt. rules and change the business logic accordingly and it must be fast
enough to save penalties.

Regards,

Chaitanya Kulkarni

On Sat, Aug 13, 2011 at 10:54 PM, s...@bestmx.ru  wrote:

> c k wrote:
>
>  from last few months I am reading and searching for can postgresql
>> used as application server?
>> So i am thinking if I can use postgresql as web application server.
>>
>> I request to users and developers give your suggestions and opinions.
>> Waiting for your replies.
>>
>
> Yes! Yes And Yes, my friend!
> You should!
>
> i am using postgresql exactly as application server.
> (stored procedures in PLpgsql)
> at http://platzcart.com i managed to minimize server side scripting:
> Stored procedures run entire "business logic" + PHP envelop results into
> HTML code.
>
> and in the next project (yet under construction)
> i managed to ELIMINATE server side scripting at all
> (except captcha server, which is standalone (written in perl))
> PLpgsql "business logic" again + client side JS is building presentation.
>
> most important point to support you is
> *This is the originally intended usage of a DBMS*
>
> All the troubles, all the NoSQL whining caused by unnecessary middleware.
>
> P.S.
> i have held a report to NLUUG Spring Conference 2011
> about platzcart.com implementation
> it is located at 
> http://platzcart.com/lib/**platzcart.pdf
> it clearly describes advantages of using postgresql as an application
> server.
> and i am sure it explains the good practice (maybe the best one)
>
> P.P.S.
> now i am using nginx_http_postgres_module
>
>
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-ad...@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-admin
>


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-13 Thread s...@bestmx.ru

c k wrote:
Yes, I know that I can not create a simple web application using only 
postgresql because we need a web server to server the html content.

u r wrong.
u CAN!

there is nginx_htttp_postgresql_module
exactly to connect webserver directly to postgresql
and to OUTPUT query result to a browser.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-13 Thread c k
can u please give me it's link.
I found ngx_postgres module.

Chaitanya Kulkarni

On Sun, Aug 14, 2011 at 12:14 AM, s...@bestmx.ru  wrote:

> c k wrote:
>
>> Yes, I know that I can not create a simple web application using only
>> postgresql because we need a web server to server the html content.
>>
> u r wrong.
> u CAN!
>
> there is nginx_htttp_postgresql_module
> exactly to connect webserver directly to postgresql
> and to OUTPUT query result to a browser.
>


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-13 Thread s...@bestmx.ru

can u please give me it's link.
I found ngx_postgres module.



there is nginx_htttp_postgresql_module
exactly to connect webserver directly to postgresql
and to OUTPUT query result to a browser.


http://wiki.nginx.org/3rdPartyModules
http://labs.frickle.com/nginx_ngx_postgres/

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-13 Thread Rich Shepard

On Sun, 14 Aug 2011, c k wrote:


I would like to generate content dynamically. I want minimum developers to
be required, simple and powerful security and administration, and most
importantly ability to respond to changes.

For my application the most important part is generating dynamic content.


Chaitanya,

  There are three major components of a database application: the dbms back
end (postgres in this case), middleware (in the language of your choice),
and the UI. The UI will use apache to display pages and accept user input.
The middleware contains business logic and is the interface between the user
and the back end.

  Each (scripting) language has application development frameworks. My
partner (a highly experienced software engineer) is using Ruby on Rails for
one of our projects. It is powerful but has a long learning curve and you
need to do everything the Rails way. In python (my scripting language of
choice) there's django, turbogears, pylon, and probably many more.

  Depending on the approach you select you may be able to meet all your
desired attributes as above. What you might consider doing is list those
requirements in order of importance and focus on meeting the most important
ones. This may mean droping other preferences (e.g., minumum number of
developers unless you have a long lead time for this project).

Rich

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-14 Thread c k
Thanks for everyone.
I will give reply after some experiments.
Regards,

Chaitanya Kulkarni

On Sun, Aug 14, 2011 at 6:04 PM,  wrote:

> On Aug 14 2011, Uwe Schroeder wrote:
>
>
>>
>>  > can u please give me it's link.
>>> > I found ngx_postgres module.
>>> > >> there is nginx_htttp_postgresql_module
>>> >> exactly to connect webserver directly to postgresql
>>> >> and to OUTPUT query result to a browser.
>>>
>>> http://wiki.nginx.org/**3rdPartyModules
>>> http://labs.frickle.com/nginx_**ngx_postgres/
>>>
>>
>>
>  Personally I'd never ever hook my database directly to the internet - for
>> me that's like writing your PIN on your banking card and leave it next to
>> the ATM :-)
>>
>
>
> DSTABASE IS THE BEST TOOL TO AGGANGE AN ACCESS CONTROL SCHEME
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-ad...@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-admin
>


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-15 Thread Scott Marlowe
On Sat, Aug 13, 2011 at 9:57 AM, c k  wrote:
> Dear Postgres users,
> from last few months I am reading and searching for can postgresql used as
> application server? As postgresql supports many languages like pl/perl,

Besides the previously mentioned nginx module there's apache's mod
libpq http://asmith.id.au/mod_libpq.html

But I'd stick to a language to wrap stuff in like php etc.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-15 Thread Benjamin Krajmalnik
Further to Scott's comment, we are running our application platform on
nginx/php (using php-fpm).
It scales very well and it is extremely fast.
When running under Apache, we had to constantly restart the apache
service because it could not handle the load (at 150 concurrent users
hitting the app it would pretty much grind to a standstill).  We moved
to Nginx, have quadrupled the number of devices which are accessing our
platform, and the number of php processes which are actually running is
< 10.  I had allocated a dynamic pool whereby we have 35 processes ready
to accept requests at all times and which can dynamically scale up, but
it does not come close to needing to use all of the existing processes.
Everything is running under FreeBSD 8.1 amd64.

As Scott mentioned, wrapping it into a real language is much better -
the extent of what you will be able to do within the module will be
severely limited vs a real language.


> -Original Message-
> From: pgsql-admin-ow...@postgresql.org [mailto:pgsql-admin-
> ow...@postgresql.org] On Behalf Of Scott Marlowe
> Sent: Monday, August 15, 2011 9:54 AM
> To: c k
> Cc: pgsql-general@postgresql.org; pgsql-admin
> Subject: Re: [ADMIN] Using Postgresql as application server
> 
> On Sat, Aug 13, 2011 at 9:57 AM, c k 
> wrote:
> > Dear Postgres users,
> > from last few months I am reading and searching for can postgresql
> used as
> > application server? As postgresql supports many languages like
> pl/perl,
> 
> Besides the previously mentioned nginx module there's apache's mod
> libpq http://asmith.id.au/mod_libpq.html
> 
> But I'd stick to a language to wrap stuff in like php etc.
> 
> --
> Sent via pgsql-admin mailing list (pgsql-ad...@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-15 Thread s...@bestmx.ru

Scott Marlowe пишет:

On Sat, Aug 13, 2011 at 9:57 AM, c k  wrote:

Dear Postgres users,
from last few months I am reading and searching for can postgresql used as
application server? As postgresql supports many languages like pl/perl,

Besides the previously mentioned nginx module there's apache's mod
libpq http://asmith.id.au/mod_libpq.html

But I'd stick to a language to wrap stuff in like php etc.


BTW, string concatenation in postgresql (plpgsql) is FASTER than in PHP



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-15 Thread Scott Marlowe
On Mon, Aug 15, 2011 at 11:33 AM, s...@bestmx.ru  wrote:
> Scott Marlowe пишет:
>>
>> On Sat, Aug 13, 2011 at 9:57 AM, c k  wrote:
>>>
>>> Dear Postgres users,
>>> from last few months I am reading and searching for can postgresql used
>>> as
>>> application server? As postgresql supports many languages like pl/perl,
>>
>> Besides the previously mentioned nginx module there's apache's mod
>> libpq http://asmith.id.au/mod_libpq.html
>>
>> But I'd stick to a language to wrap stuff in like php etc.
>
> BTW, string concatenation in postgresql (plpgsql) is FASTER than in PHP

But I can throw 1,000 cores at a large load with php.  Much harder to
do with plpgsql.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread s...@bestmx.ru

Scott Marlowe пишет:

On Mon, Aug 15, 2011 at 11:33 AM, s...@bestmx.ru  wrote:

Scott Marlowe пишет:

On Sat, Aug 13, 2011 at 9:57 AM, c kwrote:

Dear Postgres users,
from last few months I am reading and searching for can postgresql used
as
application server? As postgresql supports many languages like pl/perl,

Besides the previously mentioned nginx module there's apache's mod
libpq http://asmith.id.au/mod_libpq.html

But I'd stick to a language to wrap stuff in like php etc.

BTW, string concatenation in postgresql (plpgsql) is FASTER than in PHP

But I can throw 1,000 cores at a large load with php.  Much harder to
do with plpgsql.

and?
all of them would inevitably connect the same postgresql

the solution is outside the scope.
...a web-server page cache is one element of a solution

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread John DeSoi

On Aug 13, 2011, at 2:44 PM, s...@bestmx.ru wrote:

> c k wrote:
>> Yes, I know that I can not create a simple web application using only 
>> postgresql because we need a web server to server the html content.
> u r wrong.
> u CAN!
> 
> there is nginx_htttp_postgresql_module
> exactly to connect webserver directly to postgresql
> and to OUTPUT query result to a browser.
> 


You could also use something like node.js which allows you to connect 
Javascript directly to Postgres using the front end/back end protocol. 

With something like this, you could talk directly to Postgres from the browser:

http://ajaxian.com/archives/tcpsocket-sockets-in-the-browser

http://www.postgresql.org/docs/9.0/interactive/protocol.html

I'm not saying this is the right approach, but if that is what you are really 
after...



John DeSoi, Ph.D.




-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Scott Marlowe
2011/8/16 s...@bestmx.ru :
> Scott Marlowe пишет:
>>
>> On Mon, Aug 15, 2011 at 11:33 AM, s...@bestmx.ru  wrote:
>>>
>>> Scott Marlowe пишет:

 On Sat, Aug 13, 2011 at 9:57 AM, c k
  wrote:
>
> Dear Postgres users,
> from last few months I am reading and searching for can postgresql used
> as
> application server? As postgresql supports many languages like pl/perl,

 Besides the previously mentioned nginx module there's apache's mod
 libpq http://asmith.id.au/mod_libpq.html

 But I'd stick to a language to wrap stuff in like php etc.
>>>
>>> BTW, string concatenation in postgresql (plpgsql) is FASTER than in PHP
>>
>> But I can throw 1,000 cores at a large load with php.  Much harder to
>> do with plpgsql.
>
> and?
> all of them would inevitably connect the same postgresql

And they'd each need postgresql to do a concat?  I'd hope nobody was
dumb enough to program the app layer to do something like that.  PG
might make a decent app server, but there's no way you could scale it
to millions of users like you could a farm of app servers.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Evan Rempel

Technically it can be done, but just because we can do something does not
mean we should do something. Having said that...

We have been using a middleware product that shall remain nameless,
that goes against a large commercial database that shall also remain nameless.
The middleware has been migrating to a more and more database based code
set, and as an administrator of such a system I can state that this is
awful.

Getting appropriate logging out of the application logic for both auditing 
purposes
and trouble shooting is near impossible. Performance is nearly impossible to 
tune as
everything runs inside the database. One giant process chewing up cores of CPU 
power.


Security is near impossible to manage as well. Again, almost everything needs 
to run as
the same user. The database is now making calls to generate pdf objects and make
printing calls.

None of the traditional tools can be used to integrate the application into the 
enterprise.
The load balancer needs to add x-forwarded headers to http requests, but the
custom http code can't handle that, so all web access appears to come from the 
load
balancer. This violates regulatory requirements. Log file formats are not 
standard
since none of the code is standard, this means that none of the event 
correlation
tools can be used for intrusion detection etc.

It is just a nightmare. The previous version that had real middleware and real 
database
servers was much better. The workloads were different so each server could be 
tuned for
what it was doing. We were able to purchase hardware appropriate to the task. 
Big RAM
for database, big CPU for middleware. Overall it was cheaper.

Just my $0.02

Evan

Scott Marlowe wrote:

2011/8/16 s...@bestmx.ru :

Scott Marlowe ÐÉÛÅÔ:

On Mon, Aug 15, 2011 at 11:33 AM, s...@bestmx.ru šwrote:

Scott Marlowe ÐÉÛÅÔ:

On Sat, Aug 13, 2011 at 9:57 AM, c k
šwrote:

Dear Postgres users,
from last few months I am reading and searching for can postgresql used
as
application server? As postgresql supports many languages like pl/perl,

Besides the previously mentioned nginx module there's apache's mod
libpq http://asmith.id.au/mod_libpq.html

But I'd stick to a language to wrap stuff in like php etc.

BTW, string concatenation in postgresql (plpgsql) is FASTER than in PHP

But I can throw 1,000 cores at a large load with php. šMuch harder to
do with plpgsql.

and?
all of them would inevitably connect the same postgresql


And they'd each need postgresql to do a concat?  I'd hope nobody was
dumb enough to program the app layer to do something like that.  PG
might make a decent app server, but there's no way you could scale it
to millions of users like you could a farm of app servers.





--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread s...@bestmx.ru

Evan Rempel пишет:
Security is near impossible to manage as well. Again, almost 
everything needs to run as

the same user.


throw your nameless DMS away, or fire the architect.


Scott Marlowe ÐÉÛÅÔ:

On Mon, Aug 15, 2011 at 11:33 AM, s...@bestmx.ru šwrote:

Scott Marlowe ÐÉÛÅÔ:

On Sat, Aug 13, 2011 at 9:57 AM, c k
šwrote:

Dear Postgres users,
from last few months I am reading and searching for can 
postgresql used

as
application server? As postgresql supports many languages like 
pl/perl,

Besides the previously mentioned nginx module there's apache's mod
libpq http://asmith.id.au/mod_libpq.html

But I'd stick to a language to wrap stuff in like php etc.
BTW, string concatenation in postgresql (plpgsql) is FASTER than 
in PHP

But I can throw 1,000 cores at a large load with php. šMuch harder to
do with plpgsql.

and?
all of them would inevitably connect the same postgresql


And they'd each need postgresql to do a concat? I'd hope nobody was
dumb enough to program the app layer to do something like that. PG
might make a decent app server, but there's no way you could scale it
to millions of users like you could a farm of app servers.


2011/8/16 s...@bestmx.ru :





--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Chris Travers
I can't let this slide :-D

On Tue, Aug 16, 2011 at 9:27 AM, Evan Rempel  wrote:
> Technically it can be done, but just because we can do something does not
> mean we should do something. Having said that...
>
> We have been using a middleware product that shall remain nameless,
> that goes against a large commercial database that shall also remain
> nameless.
> The middleware has been migrating to a more and more database based code
> set, and as an administrator of such a system I can state that this is
> awful.

>From your description below, it truly sounds awful.  However, this
strikes me as being an issue of *which* logic is moved into the
database instead of *that* logic is being moved into the database.
>
> Getting appropriate logging out of the application logic for both auditing
> purposes
> and trouble shooting is near impossible. Performance is nearly impossible to
> tune as
> everything runs inside the database. One giant process chewing up cores of
> CPU power.

LedgerSMB has been moving in the direction of more logic in the
database because we have found the opposite.  Troubleshooting is
easier, code maintenance is easier, performance is easier to
troubleshoot and manage, and security is far more manageable.  Now,
granted we are retrofitting security onto a codebase which had none
when we forked, so that is a difference.  We have eliminated a
much larger number of bottlenecks by going this way than we have run
into.  Again the issue is *which* logic goes into the db, and that's
an absolutely key question when running middle tiers in the dbms.
>
>
> Security is near impossible to manage as well. Again, almost everything
> needs to run as
> the same user. The database is now making calls to generate pdf objects and
> make
> printing calls.

Ouch I guess I could kinda see the PDF generation calls (I'd still
prefer a queue and transform approach), but not the printing calls.
And if you can't move security into the database, then you have a kind
of major problem:  you aren't *really* generating a consistent and
consistently enforced API in this way, and so you can't get to the
roles a middleware solution gives you.

As long as you still need the middleware, then the question really
becomes, what logic needs to be centralized in the db and what logic
is specific to each middleware application?  What do you get from
putting each thing in the database?  My recommendation is to review
that.  If it is a single app db, then use stored procs as essentially
named queries.  If it is possible, move the printing calls into a
separate process and have it signalled by the db app on database
commit.

But it really sounds like an unmaintainable mess.  IME, however, that
is avoidable while still placing the RDBMS in the center of the
logic-complete application server environment.
>
> None of the traditional tools can be used to integrate the application into
> the enterprise.
> The load balancer needs to add x-forwarded headers to http requests, but the
> custom http code can't handle that, so all web access appears to come from
> the load
> balancer. This violates regulatory requirements. Log file formats are not
> standard
> since none of the code is standard, this means that none of the event
> correlation
> tools can be used for intrusion detection etc.

Ouch.  I second the suggestion that the architecture here lacks
the separation of concerns approach necessary to make this work, and
that either the software you are using is the problem or the architect
is.  However, it doesn't tell me that the approach of using the RDBMS
as the entry point into an application server environment is
necessarily a bad thing.

Best Wishes,
Chris Travers

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Merlin Moncure
On Tue, Aug 16, 2011 at 11:27 AM, Evan Rempel  wrote:
> Technically it can be done, but just because we can do something does not
> mean we should do something. Having said that...
>
> We have been using a middleware product that shall remain nameless,
> that goes against a large commercial database that shall also remain
> nameless.
> The middleware has been migrating to a more and more database based code
> set, and as an administrator of such a system I can state that this is
> awful.
>
> Getting appropriate logging out of the application logic for both auditing
> purposes
> and trouble shooting is near impossible. Performance is nearly impossible to
> tune as
> everything runs inside the database. One giant process chewing up cores of
> CPU power.
>
>
> Security is near impossible to manage as well. Again, almost everything
> needs to run as
> the same user. The database is now making calls to generate pdf objects and
> make
> printing calls.
>
> None of the traditional tools can be used to integrate the application into
> the enterprise.
> The load balancer needs to add x-forwarded headers to http requests, but the
> custom http code can't handle that, so all web access appears to come from
> the load
> balancer. This violates regulatory requirements. Log file formats are not
> standard
> since none of the code is standard, this means that none of the event
> correlation
> tools can be used for intrusion detection etc.
>
> It is just a nightmare. The previous version that had real middleware and
> real database
> servers was much better. The workloads were different so each server could
> be tuned for
> what it was doing. We were able to purchase hardware appropriate to the
> task. Big RAM
> for database, big CPU for middleware. Overall it was cheaper.

very few of those complaints would apply to postgres -- the database
does not run in a single process (thank goodness for that!), logging
via the various pls is trivially done and effective, etc.  also if
you're serving http it does make sense to wrap postgres with a thin
http server (lighttpd, node.js, nginx are all good choices).   most of
the rest of your gripes seem to apply more to the specific middleware
implementation vs a general appraisal of the technique.  it's trivial
to implement database side security systems and many people do so.

one point that is getting lost in all this that if you are using a
database for an application server, this does not mean it's the same
database as your main database or even on the same machine -- you can
still keep traditional separation of roles and use something like
dblink to transfer data.  regarding the use of postgres functions for
things like reports and pdf generation, I see absolutely nothing wrong
with doing this...although plpgsql is not a very good
choice...pl/python or pl/java would be a better way to go.

merlin

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread Scott Marlowe
On Tue, Aug 16, 2011 at 12:25 PM, Merlin Moncure  wrote:
> one point that is getting lost in all this that if you are using a
> database for an application server, this does not mean it's the same
> database as your main database or even on the same machine -- you can
> still keep traditional separation of roles and use something like
> dblink to transfer data.  regarding the use of postgres functions for

I'm thining pl/proxy would be pretty amazing here.  I still prefer
using another layer in another language for an app server, but now
that you've got me thinking a bit more out of the box, pl/proxy would
increase your ability to scale quite a lot.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] [ADMIN] Using Postgresql as application server

2011-08-16 Thread c k
I want to use the postgresql for exactly the same use. I want to keep my
database separate and use another postgresql machine just as application
server. Even for load balancing and scaling we can use many techniques mixed
to get the work done.

Chaitanya Kulkarni

On Tue, Aug 16, 2011 at 11:55 PM, Merlin Moncure  wrote:

> On Tue, Aug 16, 2011 at 11:27 AM, Evan Rempel  wrote:
> > Technically it can be done, but just because we can do something does not
> > mean we should do something. Having said that...
> >
> > We have been using a middleware product that shall remain nameless,
> > that goes against a large commercial database that shall also remain
> > nameless.
> > The middleware has been migrating to a more and more database based code
> > set, and as an administrator of such a system I can state that this is
> > awful.
> >
> > Getting appropriate logging out of the application logic for both
> auditing
> > purposes
> > and trouble shooting is near impossible. Performance is nearly impossible
> to
> > tune as
> > everything runs inside the database. One giant process chewing up cores
> of
> > CPU power.
> >
> >
> > Security is near impossible to manage as well. Again, almost everything
> > needs to run as
> > the same user. The database is now making calls to generate pdf objects
> and
> > make
> > printing calls.
> >
> > None of the traditional tools can be used to integrate the application
> into
> > the enterprise.
> > The load balancer needs to add x-forwarded headers to http requests, but
> the
> > custom http code can't handle that, so all web access appears to come
> from
> > the load
> > balancer. This violates regulatory requirements. Log file formats are not
> > standard
> > since none of the code is standard, this means that none of the event
> > correlation
> > tools can be used for intrusion detection etc.
> >
> > It is just a nightmare. The previous version that had real middleware and
> > real database
> > servers was much better. The workloads were different so each server
> could
> > be tuned for
> > what it was doing. We were able to purchase hardware appropriate to the
> > task. Big RAM
> > for database, big CPU for middleware. Overall it was cheaper.
>
> very few of those complaints would apply to postgres -- the database
> does not run in a single process (thank goodness for that!), logging
> via the various pls is trivially done and effective, etc.  also if
> you're serving http it does make sense to wrap postgres with a thin
> http server (lighttpd, node.js, nginx are all good choices).   most of
> the rest of your gripes seem to apply more to the specific middleware
> implementation vs a general appraisal of the technique.  it's trivial
> to implement database side security systems and many people do so.
>
> one point that is getting lost in all this that if you are using a
> database for an application server, this does not mean it's the same
> database as your main database or even on the same machine -- you can
> still keep traditional separation of roles and use something like
> dblink to transfer data.  regarding the use of postgres functions for
> things like reports and pdf generation, I see absolutely nothing wrong
> with doing this...although plpgsql is not a very good
> choice...pl/python or pl/java would be a better way to go.
>
> merlin
>
> --
> Sent via pgsql-admin mailing list (pgsql-ad...@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>