We have a system in mind whereby we will use the Meteor stack as is, but in addition we would like to have additional sources of live data that we would like to subscribe to.
I assume this would involve implementing DDP for the other data sources (in this case a Riak DB, and potentially RabbitMQ)
The additional sources would be read-only, but we need to update things based on the changes in the DB, hence the need for some sort of subscription.
so my question is
- Given that we need to have multiple livedata sources, is implementing DDP even the correct approach?
- Where would i start implementing DDP for Riak (pointers, examples if possible)?
- Is there possibly some simpler way to achieve live updates from multiple sources, given that the extra sources would be read-only?
Thanks in advance 🙂
DDP is a client/server protocol, not a server to database protocol. This is not the approach I would take, especially for read-only data.
Instead I would wrap a Riak node.js library into a Meteor package, using a Fiber. You could look at the Mongo driver for a complicated example of this, or the HTTP package for a simpler example. (Packages are found in /usr/local/meteor/packages)
As the node driver returns data, it would call back into your Meteor to populate the collection. See a code snippet at In Meteor, how to remove items from a non-Mongo Collection?