Re: Josh's Comments on Hstore / Jsonb - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Josh's Comments on Hstore / Jsonb
Date
Msg-id CAHyXU0yrSXdNqWGSDjOK27KOpUSV7_HrCc4O=VQ7tUQVpUvHQQ@mail.gmail.com
Whole thread Raw
In response to Josh's Comments on Hstore / Jsonb  ("john.tiger" <john.tigernassau@gmail.com>)
List pgsql-general
On Thu, Feb 27, 2014 at 6:16 PM, Brett Mc Bride
<brett.mcbride@deakin.edu.au> wrote:
> I'm in the process of prototyping a DB-backed REST web service as a
> side-project. It's still early
> days, but I've been handed a PHP/mysql setup.
> After a bit of searching around, I thought that the exact combination above
> (node.json/express +
> node-postgres), possibly coupled with JSON datatypes, could be a really
> effective solution. ()
>
> Now for the advocacy part - before I saw this thread I wasn't sure whether
> there were any real-world
> implementations of this combination. Are there any good skeletons or
> prototypes out there to get a
> RESTful web service up and running with express and postgres?

Express *is* the skeleton.  If you are handing auth and session mgmt
in node that's were the bulk of your code will be at the service
level.  If not, things are even easier:  my web service calls tend to
boil down to almost one liners: postgres returns pre-packaged json and
node just flips it to the client.   I've gotten pretty adept at json
serialization: when the application page refreshes I'll stuff as many
things into one json object as possible.

Posting data back to the database is more complex so you have to
decide if you want to let the database handle the json decomposition
(this requires 9.3) or reduce it to SQL in node.  I prefer the
database because things are simplified when you don't have to use
connection pooling.

merlin


pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgrestore command
Next
From: John R Pierce
Date:
Subject: Re: pgrestore command