Reputation: 58786
How does Meteor.js detect changes in MongoDB or Mysql? Does it add triggers, or does it poll for changes? If if polls for changes then this seems a rather expensive operation
I also found an explanation on the Meteor site after some more digging around:
https://www.meteor.com/livequery
Upvotes: 1
Views: 489
Reputation: 4101
For MongoDB, Meteor tails the operation log (oplog) for changes. In production, this requires the database to be set up as a replica set (a one-member replica set is fine); if it isn't then it will fall back to polling. In development mode, oplog tailing is enabled by default. For more information, see this (slightly out-of-date) wiki page.
There's no native MySQL support in Meteor. There are packages which add MySQL support, but you'll have to read those packages' documentation to see if it uses triggers or polling.
Upvotes: 3