Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Since postgres has basic json type support now, and PL/Javascript exists, it's only a matter of time until an extension appears that lets you deploy javascript applications directly to the database.

Who needs CouchDB or Node.js when you can just say CREATE EXTENSION 'couchnodegres.js'



Once the database can start receiving and returning json, then you can treat it as a webservice and not have the client involved in SQL. I think this is huge.


Just FYI, this is already half-true:

"With PostgreSQL 9.2, query results can be returned as JSON data types."

It also supports the PL/V8 stored procedure format, which is Javascript http://code.google.com/p/plv8js/wiki/PLV8

It's very, very close.


Can you elaborate a little bit on how an architecture like that would look like? I had great hopes for CouchDB once.


HTML/JS frontend calls simple node server that does nothing but call a stored procedure like

   spc_handle_request(req_headers, req_body, http_method, ...)
stored procedure does simple routing and does something like

  insert into table (a, b, c) values (to_json(req_body).a, to_json(req_body).b, to_json(req_body).c);
or

  to_json(select * from emp);
Time to implement simple crud app: 10 minutes.


yet it will not cease comparsions of postgres to mysql




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: