Learn How to Build this Realtime Blackboad app With Meteor Streams - Download Free eBook now!
Scaling Support
If you decided to scale your app horizontally, by default Meteor Streams works within a single instance only. As an example lets say you are going to have 3 meteor instances (A, B, C). Now events emitted from instance A cannot be listen from B or C.
But simply integrating Meteor Cluster you can remove this limitation. See below for the integration.
We assume your app runs on locally, and a local redis-server is running. See here for advanced Meteor Cluster configuration.
- Add
cluster
smart package withmrt add cluster
- Sync streams with
cluster
as shown below
Add following content to cluster.js
if(Meteor.isServer) {
Meteor.startup(function() {
Meteor.Cluster.init();
//stream1, stream2 are the Meteor Streams available on your app
Meteor.Cluster.sync(stream1, stream2);
});
}
- Now you can start as many as meteor instances you want