The blog posts go into more details: http://legitimatesounding.com/blog/building_a_mongodb_clone_... and http://legitimatesounding.com/blog/building_a_mongodb_clone_...
Which leads to a question for the OP: does this work with mongoose.js?
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 ;)
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).
What happened to separating the data access layer from the business logic layer? Oh yeah, "good architectural practices are so JEE ..." /s
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.