I want to build an IoT app which uses Arduino, Go and Meteor.js.
I would like the Go APIs to process payloads coming from the Arduino via MQTT. This data should then go into MongoDB, which is shared with a Meteor.js application that displays the gathered real time information.
Do you see any problem with this setup? Are there going to be any sync problems between the data being stored and what is displayed in the frontend?
Sounds perfectly doable to me.
Only caveat I’ve run into is that if you use collection hooks (before/after/etc) in your Meteor app, they won’t run for changes that come via the Go app (as they live inside the data layer of meteor’s app code).
If you need that behaviour on the Meteor side, you can use
Mongo.Cursor#observeChanges and run hooks to modify the documents there