Re: question about HTTP API

From: Andrew Tipton <andrew(at)kiwidrew(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: question about HTTP API
Date: 2013-08-09 08:49:15
Message-ID: CA+M2pVX4CnvCdHmQzPP1OeNwgP956_sp-6jw2xe-P0QNe-vKAw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Aug 9, 2013 at 3:44 AM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:

> Well, there's HTSQL: http://htsql.org/
>
> Other than that, no. I was thinking of creating a general tool as a
> custom background worker, which would take stored procedure calls and
> pass them through to PostgreSQL, returning results as JSON. Mainly
> because I need it for a project. However, this wouldn't accept any query.

I'm actually in the process of writing an HTTP server that lives inside
Postgres. I hope to have a WIP patch ready in the next week or two, and
then (if all goes well) submit it for CF2. [There are a few impediments to
doing this as an extension module, which I shall detail as part of the WIP
patch...]

Why integrate a webserver with Postgres? Well, the trend that we're seeing
in web development is to push much of the display logic into client-side
Javascript frameworks and expose the database through an HTTP API. (Good
examples of this are Parse and Meteor.) CouchDB can even host the
application's static content alongside the data. As a result, many
applications don't need any middle-tier Python/Ruby/Java framework at all.

One of my goals is to allow Postgres to directly serve HTTP requests and
return arbitrary content (e.g. text/html in addition to JSON) directly to
end-user browsers. With the JSON datatype and PL/v8, code can even be
re-used on both client and server. Getting rid of an entire middle tier
would make small-scale application development dramatically easier.

Regards,
Andrew Tipton

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2013-08-09 09:03:04 Re: question about HTTP API
Previous Message Andrew Tipton 2013-08-09 08:21:52 Re: question about HTTP API