Scaling a MeteorJS application
Whatever we have discussed is good for a single instance application. If our application grows with a bigger user base and if the traffic is increasing, we obviously have to scale the system. Most of the time, scaling can be done horizontally, which means we will add more instances and then route the traffic to instances having less load at the moment. With some scaling solutions such as meteor cluster, we can scale vertically by adding more cores to the server.
Let's see in detail how Nginx and meteor cluster help us in scaling our application.
Scaling with Nginx
We have seen how to use Nginx while doing MDM setup. Now, let us see how to use it to scale MeteorJS applications. It is good to install the latest Nginx that supports WebSockets. We are going to use Nginx to be a load balancer, which will redirect the requests to the application instances based on the load in each instance. All we need to do is change the Nginx configuration file to accommodate the...