From: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
---|---|
To: | Brett Mc Bride <brett(dot)mcbride(at)deakin(dot)edu(dot)au> |
Cc: | "john(dot)tiger" <john(dot)tigernassau(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Josh's Comments on Hstore / Jsonb |
Date: | 2014-02-28 14:53:24 |
Message-ID: | CAHyXU0yrSXdNqWGSDjOK27KOpUSV7_HrCc4O=VQ7tUQVpUvHQQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, Feb 27, 2014 at 6:16 PM, Brett Mc Bride
<brett(dot)mcbride(at)deakin(dot)edu(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | John R Pierce | 2014-02-28 18:23:33 | Re: pgrestore command |
Previous Message | Michael Paquier | 2014-02-28 13:06:00 | Re: pgrestore command |