Question

I am trying to evaluate whether Meteor JS would be suitable for a future project that would incorporate live chat, and may need to be scalable.

It certainly can perform the chat functions, but I don't want to paint myself into a corner if traffic spikes and we need to provision the app with more resources in the form of drones/dynos/instances. I have read that a Meteor app on Heroku won't easily scale (perhaps not at all?). I am not clear on whether this is a Heroku issue, or more to do with the current state of Meteor JS (0.6.2.1 at this time). I've not found much more related to Nodejitsu or AppFog.

Can anyone clarify whether a Meteor JS app can currently be deployed on a PaaS such that resources (drones/dynos/instances) can be easily scaled up to meet demand? If so, which Paas? If not, what is the explanation (for a 5-year-old), and is there a roadmap?

Was it helpful?

Solution

Personally I've set myself up with an AWS load balancer and EC2 instances, with my DB over at MongoHQ.

The load balancer setup was made that much easier by following these instructions:

http://www.ripariandata.com/blog/creating-an-aws-elastic-load-balancer

I wrote a script to deploy to a single EC2 instance. It wouldn't be much work to add additional remotes in case you have multiple instances:

https://github.com/matb33/meteor-ec2-install

OTHER TIPS

The best I would recommend is Meteor.com hosting (via meteor deploy).

This is because they would incorporate the ddp-proxy solution within their architecture. Its not as simple as just proxying between two meteors and using a dynamo because each user's session might be on the other server & it might cause a bit of trouble when switching over to another dynamo.

For now its free & it looks like they scale it fairly well too. I think they're also going to introduce a nicer hosting solution soon & who better to host meteor apps than meteor themselves.

If you want to deploy on your own infrastructure (EC2 for instance) you could scale up vertically for the moment until the DDP proxy is released (DDP is what meteor uses to communicate between the server and client (and soon between servers too) to make sure the state can be relayed across multiple 'dynamos'.

This answer is Heroku specific.

As far as I understand meteor application can't be scaled on Heroku on more than one dyno. The reason is that the meteor server instance holds a state for every client. This way it knows what updates to send to the client every time. Meaning that the client has to talk with the same server every time. The Heroku proxy layer doesn't provide this kind of communication and can route client request to a different dyno which does't hold client state.

So now the server has to get all client data from the db and send everything back to the client. The server gets loaded and the client gets updated. So we have two dynos, we do twice the work and add lots of noise to the client.

I hope it is clear enough.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top