Search Postgresql Archives

Re: Josh's Comments on Hstore / Jsonb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 27, 2014 at 6:16 PM, Brett Mc Bride
<brett.mcbride@xxxxxxxxxxxxx> 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


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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux