News for hackers. Stuff that matters.
Re:A proof of concept MongoDB clone built on Postgres by rbryan71 on Monday April 20, 2015 @08:15AM (#9407471)
Why?
Re:A proof of concept MongoDB clone built on Postgres by jerrysievert on Monday April 20, 2015 @10:12AM (#9408182)
Developer here (woke up surprised it was on hn again), why not?

The blog posts go into more details: http://legitimatesounding.com/blog/building_a_mongodb_clone_... and http://legitimatesounding.com/blog/building_a_mongodb_clone_...

Re:A proof of concept MongoDB clone built on Postgres by bryanlarsen on Monday April 20, 2015 @08:29AM (#9407568)
I suspect there are lots of people who built applications on top of MongoDB who would like to transition away from Mongo onto a different database, or would at least like the option to be able to to. This may provide a good mechanism for a transition.

Which leads to a question for the OP: does this work with mongoose.js?

Re:A proof of concept MongoDB clone built on Postgres by jerrysievert on Monday April 20, 2015 @01:41PM (#9409631)
i started a mongo client implementation in node.js, but it fell off my radar - the goal was to get it to work with mongoose, etc: https://github.com/JerrySievert/mongolike-client (it is not yet complete).

in the end, i just wrote my own database system, with a query language that could act as an intermediary from multiple sources (SQL, mongo, etc).

but, this stuff is mostly just for fun, my day job keeps me plenty busy.

Re:A proof of concept MongoDB clone built on Postgres by prottmann on Monday April 20, 2015 @09:46AM (#9407993)
Could be interessting for meteor.com, the mongodb only usage prevent me to use it.
Re:A proof of concept MongoDB clone built on Postgres by aikah on Monday April 20, 2015 @10:42AM (#9408385)
problem : meteor relies on a specific mongodb feature,ie polling the db for any change. I heard there is experimental support for PG but it seems to rely on a complex hack using triggers ... So the issue isn't really about mongo queries, but whether it is possible to track db edits from third parties or not.
Re:A proof of concept MongoDB clone built on Postgres by anarazel on Monday April 20, 2015 @11:54AM (#9408912)
There's infrastructure for that in postgres, since 9.4. See

http://www.postgresql.org/docs/devel/static/logicaldecoding.... for the (somewhat low level) description of the feature. You'd have to write an output plugin that formats the output as json, but that should be pretty easy.

Disclaimer: I'm the author of the feature ;)

Re:A proof of concept MongoDB clone built on Postgres by ahachete on Monday April 20, 2015 @07:28PM (#9411447)
That specific MongoDB feature is "tailing the oplog", where the oplog is the capped collection with the idempotent commands that represent the changes in the database. This is what Meteor uses to receive (be pushed) changes (not polling).

Certainly, logical decoding provides the necessary infrastructure to implement it (and also normal tailable cursors): thank you Andres, really nice work! :) But some work is also needed to transform the representation you are using in PostgreSQL into MongoDB's oplog entries.

This is definitely what we are using in ToroDB to emulate it (currently, under development).

Re:A proof of concept MongoDB clone built on Postgres by aikah on Monday April 20, 2015 @10:44AM (#9408398)
> I suspect there are lots of people who built applications on top of MongoDB who would like to transition away from Mongo onto a different database

What happened to separating the data access layer from the business logic layer? Oh yeah, "good architectural practices are so JEE ..." /s

Re:A proof of concept MongoDB clone built on Postgres by DrJokepu on Monday April 20, 2015 @11:09AM (#9408577)
Taking full advantage of the capabilities of the data layer has effects on the business logic layer. Sometimes it's worth it, sometimes it isn't.