How does the Meteor JavaScript framework work?


I came across Meteor and while it seems exciting, I want to know how it works. I mean conventional web applications work like this: You have scripts on server which take data from database and add that dynamically to web-pages and the user-submitted data gets added to databases through some other scrips.

But how do these things work in Meteor? How are different parts of Meteor related to each other?

7/18/2015 2:44:01 PM

Meteor is a framework that elegantly updates HTML in realtime.

The beauty of Meteor is that you only need to create the templates and the data models. The rest of the usual boilerplate code is hidden away. You don't need to write all the sync-ing code.

The key pieces of Meteor could be built yourself using these pieces:

  • It provides templating that updates automatically when your data models do. This is normally done using Backbone.js, Ember.js, Knockout.js, or another tool.

  • The client/server messaging is done via websockets using something like socks.js or

  • The client side connection to MongoDB is really cool. It replicates the MongoDB-server driver into the client. Unfortunately, last I checked, they were still working on securing this database connection.

  • The latency compensation is simply updating the client-side model first, then sending the update to the server-server.

There may be other neat pieces to that you can find on the Meteor site, or on GitHub.

7/18/2015 2:47:27 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow