How does the Meteor.js Javascript framework work?

- QUESTION -

I came across meteor.js and while it seems exciting, I want to know how it works. I mean conventional web-apps 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 meteorJS? How are different parts or meteorJS related to each other?

- ANSWER -

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.jsEmber.jsKnockout.js, or another tool.
  • The client/server messaging is done via websockets using something like socks.js orsocket.io.
  • The client side connection to mongodb is really cool. It replicates the mongo-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.JS site, or on Github

0 comments:

Post a Comment

Powered by Blogger.