6 ms·
Could be interessting for meteor.com, the mongodb only usage prevent me to use it.
by prottmann 11y ago
Could be interessting for meteor.com, the mongodb only usage prevent me to use it.
- aikah 11y agoproblem : 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.
- anarazel 11y agoThere's infrastructure for that in postgres, since 9.4. See http://www.postgresql.org/docs/devel/static/logicaldecoding.html 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 ;)
- ahachete 11y agoThat 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).