News for hackers. Stuff that matters.
Re:PgREST: Node.js in the Database, compatible with MongoLab... by JonnieCache on Friday November 29, 2013 @05:06AM (#6818700)
>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 hstore functionality is finished, ie. nesting?

See: http://obartunov.livejournal.com/175235.html

Re:PgREST: Node.js in the Database, compatible with MongoLab... by recuter on Friday November 29, 2013 @08:17AM (#6819274)
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... by audreyt on Friday November 29, 2013 @05:43AM (#6818822)
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.

Re:PgREST: Node.js in the Database, compatible with MongoLab... by JonnieCache on Friday November 29, 2013 @06:01AM (#6818888)
But hstore will be faster/better because it's a binary representation, right?
Re:PgREST: Node.js in the Database, compatible with MongoLab... by qooleot on Friday November 29, 2013 @09:24AM (#6819461)
JSON will be getting binary representation. Its just a matter of organizing sponsorship of the project.
Re:PgREST: Node.js in the Database, compatible with MongoLab... by JonnieCache on Friday November 29, 2013 @09:36AM (#6819510)
I assumed everyone would be encouraged to just convert their json columns to hstore if they wanted the extra speed, being as theyre equivalent. What would be the reason for funding JSON-as-binary?
Re:PgREST: Node.js in the Database, compatible with MongoLab... by rpedela on Friday November 29, 2013 @10:17AM (#6819660)
For better or worse, JSON is becoming a major format and it is a first-order Postgres data type. You need to add the hstore extension if you want it. So it makes sense for people needing/wanting JSON and are not aware of some extension called hstore. In other words, it is about improving the ease of use.
Re:PgREST: Node.js in the Database, compatible with MongoLab... by stopthemadness on Friday November 29, 2013 @11:45AM (#6820030)
Traditional databases use complicated indexing and storage structures in part to minimize the need to examine unrelated data. hstore is better than plain text for JSON but a scheme closer to the existing PostgreSQL table/page/row/value hierarchy could be better still.

I'd recommend reading the recent post https://news.ycombinator.com/item?id=6813937

Re:PgREST: Node.js in the Database, compatible with MongoLab... by JonnieCache on Friday November 29, 2013 @12:19PM (#6820183)
Of course if I need it to be eye-wateringly fast I wouldn't be using a document store. I'd use good old relational or something like redis. Often though you just need a sensible place to put some unimportant schemaless key-value data without a half dozen extra dynamically created tables or whatever. EAV makes me very sad.
Re:PgREST: Node.js in the Database, compatible with MongoLab... by audreyt on Friday November 29, 2013 @06:05AM (#6818900)
Very likely so for the majority of use cases, yes.
Re:PgREST: Node.js in the Database, compatible with MongoLab... by DrJokepu on Friday November 29, 2013 @11:54AM (#6820070)
My gut feeling is that people will keep using JSON simply because (they will believe that) it’s an awful lot more convenient than HSTORE.
Re:PgREST: Node.js in the Database, compatible with MongoLab... by kevin818 on Friday November 29, 2013 @05:11AM (#6818714)
You didn't get the memo?