After listening to the Galaxy talk between Justin and Arunoda, my excitement for Meteor’s vision is greater than ever. I think it can be the first platform to successfully abstract away the scaling challenges a start-up may face. I think it’s going to be revolutionary, but until that day comes, I have some pressing concerns about scaling Meteor. Primarily, it relates to Livequery - Meteor’s way to making MongoDB real-time by watching every operation in the database log.
For those unfamiliar with this, each Meteor server has to process every operation that happens in the database. This consumes a lot of resources and creates a performance ceiling that cannot be overcome by adding more servers. Since there are many Node/MongoDB hosting options, I was hoping Galaxy would tackle this first, but it doesn’t look like that will happen in the first version.
I’ve been thinking of how this can be overcome at a low cost. Instead of watching the MongoDB operations log, what if Meteor simply assumed that every write was successful, and pushed that action to all the app servers?
The only tradeoff I see for this approach is if MongoDB begins to fails at writes, in which case the connected clients will get the data but it won’t persist. Depending on how you look at it, it can be a good or bad thing. On the plus side, there may be less latency with this approach and it will probably get your further.
By embedding this into the Meteor app instead of plugging into MongoDB’s oplog, we can also have an easy on/off switch for which database collections are being watched and how.
Posts.observe({
insert: function () {
return true;
},
update: function () {
return true;
},
remove: function () {
return true;
}
});
In the long term, I would love to see Meteor unbundle Livequery into a seperate service and have it work the way it does now. It turns Meteor into a great integration point for other services. Maybe Galaxy can have an on/off switch for watching MongoDB’s oplog or to assume success, and this API would play right into it.
In the short term, I think this can be a good, non-premium solution, that can help people take Meteor much further with where it is today. This can also lead to a more balanced approach to designing applications with Meteor, where not every bit of the application needs to be real-time.