Scaling Meteor: The Challenges of Real-time Apps
discovermeteor.com
discovermeteor.com
> Attempting to minimize the number of unique-per-user subscriptions will allow Meteor to pool work across users as much as possible.
This kind of thing is why, no matter how much I like Meteor personally (I'm using it for my two side projects), I disagree with the marketing that Meteor is for people learning to build web applications. Despite its promises of simplicity, there are many gotchas and difficult to understand subtleties in Meteor. It is definitely not an "ultra-simple environment" once you get past the most basic apps.
What I'd really like to see at this point is some smart packages built on top of Meteor that make building basic CRUD applications simple again. Something like scaffolding from Rails. One thing I love about Meteor's accounts-ui is the "Configure OAuth" in-app wizards -- something this would be fantastic for scaffolding.
Because let's face it, how much of your average app is exciting realtime stuff and how much is writing boring forms, validation and CRUD methods to handle everything?
I'd love to try and build something like this. Now if I could just quit my day job or steal some time from my other projects.
We built what you've described with Exponential.io.
Essentially, we take a spec file and generate an Angular client, an Express API and a Mongo backend with a focus on CRUD applications.
We're doing a beta / soft launch in 2 weeks on Feb. 28.
In terms of platforms, we're releasing a solution to rapidly build an Angular + Node/Express API + Mongo (aka MEAN) on the 28th.
We'll follow-up with a solution for Meteor in short order. Interestingly, we built the Meteor solution first but are releasing the MEAN solution first as Meteor 1.0 is close, but not ready yet.
https://github.com/davedx/grindstone
I think declarative approaches should almost always supercede imperative when the solutions are so well known. It also makes it easy to build GUI's instead of having to bang out text files all the time.
Could you email me when you're ready please? davedx@gmail.com
This line confused me:
> Using simpler queries will usually mean there’s less work for Meteor to do to decide if a change affects it.
Is this right? Previous Meteor optimization articles I've read have stated the opposite, and all my years of database development have told me to avoid 'SELECT *' and other simple DB calls like the plague. But maybe I missed something in the article that explains this.
Thanks Tom and Sacha for your great contributions to the Meteor community!
What I meant here is thinking about making your publication queries simpler when designing your data models.
For instance, sometimes using denormalization you can use a simple equality selector rather than some more complex mongo selector. Mongo makes it possible to avoid the denormalization, but it might bite you as it means Meteor can't do a bunch of short-circuits that it might otherwise do on a simpler query.
Those reads are throttled, so I think the net result of too many writes is just a choked up webserver, and slow "realtime". Potentially a future architecture moves the oplog processor onto it's own server and the effect is isolated to the realtime part.
It seems that since oplog tailing doesn't work with a sharded database, then each additional Meteor process must also tail the entire oplog and evaluate all transactions for all Meteor processes.
How does this work for a site with, say, 100 transactions per second and a dozen subscriptions to observe? Does it saturate the Node event loop, or are there plenty of ticks left for the application?
And if I use 'skip' and 'limit' to page through large result sets, it looks like oplog tailing isn't an option. Is there a better way to keep the client data small and take advantage of oplog tailing?
For those of you who are interested in more in-depth oplog tailing info, there is a recorded talk from one of the Meteor Devshops: https://www.youtube.com/watch?v=_dzX_LEbZyI
You guys need to keep these posts coming!