Live data from Hacker News

PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

pgre.st

11–20 of 34 posts

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#11
post #8
post #3

Earlier quoted context omitted.

Personally I find myself looking at these and thinking "Why?"

The main motivation is to use the same set of npm-managed modules for backend and frontend model+logic. A secondary motivation is using two familiar APIs — MongoLab and Firebase — to access existing PostgreSQL databases. (We're using this in production at Socialtext and g0v.tw.)

>A secondary motivation is using two familiar APIs — MongoLab and Firebase — to access existing PostgreSQL databases.

Is there really a significant population of developers now to whom these are more familiar query languages than SQL?

Honest question.

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#12
post #10

Earlier quoted context omitted.

>Web 3.0 Is that what we're calling this whole 30 lines of javascript, mongo and redis behind the WAN, dynamic language runtime inside the DB era? Cool. EDIT: saying that, some kind of featureful document store implementation inside postgres seems inevitable. Isn't that all going to be hstore-based though, what with the new stuff coming in 9.4? I thought the json type was meant to be kind of a stopgap until the full…

Yup. Nested hstore and JSON are going to be semantically equivalent ("cast" works both ways), and PgREST will support them equally once 9.4 is released. PgREST also comes with a shim JSON type for Postgres version 9.1 and earlier, so the column type implementation is mostly hidden from the user.

But hstore will be faster/better because it's a binary representation, right?

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#13
post #8

Earlier quoted context omitted.

The main motivation is to use the same set of npm-managed modules for backend and frontend model+logic. A secondary motivation is using two familiar APIs — MongoLab and Firebase — to access existing PostgreSQL databases. (We're using this in production at Socialtext and g0v.tw.)

>A secondary motivation is using two familiar APIs — MongoLab and Firebase — to access existing PostgreSQL databases. Is there really a significant population of developers now to whom these are more familiar query languages than SQL? Honest question.

For backend programming, SQL is certainly the most familiar language.

We don't generally send SQL over the wire, though. :-)

That is to say, front-end programmers usually work with a middleware (or backend-as-a-service) layer that translates REST/JS API requests into backend storage, and PgREST simply implements this layer with Postgres itself.

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#14
post #10

Earlier quoted context omitted.

Yup. Nested hstore and JSON are going to be semantically equivalent ("cast" works both ways), and PgREST will support them equally once 9.4 is released. PgREST also comes with a shim JSON type for Postgres version 9.1 and earlier, so the column type implementation is mostly hidden from the user.

But hstore will be faster/better because it's a binary representation, right?

Very likely so for the majority of use cases, yes.

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#15
Another killer product from Firebase. They seem to be one of very few startups in the city that are executing smart and can prove it.

Looking forward to seeing what else the team comes up with since I've already replaced my MUNI estimation time app with the Firebase SF Muni app :-D

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#16
post #2

Looks quite interesting, but I can't help but admit some of these Web 3.0 solutions are getting a bit ridiculous nowadays, especially when it comes to data storage and processing.

>Web 3.0 Is that what we're calling this whole 30 lines of javascript, mongo and redis behind the WAN, dynamic language runtime inside the DB era? Cool. EDIT: saying that, some kind of featureful document store implementation inside postgres seems inevitable. Isn't that all going to be hstore-based though, what with the new stuff coming in 9.4? I thought the json type was meant to be kind of a stopgap until the full…

We added performance comparison with MongoDB. MongoDB is very slow on loading data (slide 59) - 8 minutes vs 76s, seqscan speed is the same - about 1s, index scan is very fast - 1ms vs 17 ms with GIN fast-scan patch. But we managed to create new opclass (slides 61-62) for hstore using hashing of full-paths concatenated with values and got 0.6ms, which is faster than mongodb !

It's worth noticing, that MongoDB index is very "narrow" index, while hstore's indexes could speedup more queries.

====

Well, wow. This is 6-12 months away, and really exciting.

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#17
post #9
post #2

Looks quite interesting, but I can't help but admit some of these Web 3.0 solutions are getting a bit ridiculous nowadays, especially when it comes to data storage and processing.

Web 3.0 is the semantic web, thank you very much.

I thought it was hookers covered in bacon.

Buzzwords mean whatever the fuck you want them to mean.

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#18

Another killer product from Firebase. They seem to be one of very few startups in the city that are executing smart and can prove it. Looking forward to seeing what else the team comes up with since I've already replaced my MUNI estimation time app with the Firebase SF Muni app :-D

Well, this is more like an open-source (partial) reimplementation of Firebase so anyone can host it... :-)

Firebase++ for an extremely well-thought-out API, though!

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#19
post #4

I need a simple rest json store, and this could come handy. I'm using openkeyval right now, but they have a value size limit much too low (which seems to be a bug).

Have you looked at Cloudant (https://cloudant.com/)?

Re: PgREST: Node.js in the Database, compatible with MongoLab and Firebase API

#20
post #10

Earlier quoted context omitted.

Yup. Nested hstore and JSON are going to be semantically equivalent ("cast" works both ways), and PgREST will support them equally once 9.4 is released. PgREST also comes with a shim JSON type for Postgres version 9.1 and earlier, so the column type implementation is mostly hidden from the user.

But hstore will be faster/better because it's a binary representation, right?

JSON will be getting binary representation. Its just a matter of organizing sponsorship of the project.
Post reply on HN