& Getting Started
Meteor
+ Getting Started
@jon_perl
1. Use JavaScript on the client
(since 1995)
Blocking / Threads
vs Callbacks
var result = db.query(“select * from T”)
print(result)
db.query(“select * from T”, functio...
Traditional Server
Node
1. Use JavaScript on the client
2. Use JavaScript on the server
One language to rule them all
1. Use JavaScript on the client
2. Use JavaScript on the server
3. ???
4. PROFIT!
???
Meteor
The web in 2014
• Rich applications
– Real time updates
– Single page
• Short development cycles
Seven Principles of Meteor
Data on the Wire. Send data, not HTML, over the network. Let the client
decide how to render it...
Seven Principles of Meteor
Full Stack Reactivity. Make realtime the default. All layers, from
database to template, should...
Getting Started
Install Node and Meteor
(Mac / Linux) curl https://install.meteor.com | /bin/sh
(Windows) http://win.meteo...
1. Create an example
2. Run the app
File Structure
• /server - runs on the server
• /client - runs on the client
• /, /common - runs on both
• static assets (...
Additional Resources
https://www.discovermeteor.com/
https://eventedmind.com/
http://meteorpedia.com/
http://docs.meteor.c...
1. Use JavaScript on the client
2. Use JavaScript on the server
3. Meteor
4. PROFIT!
Questions?
Credits
Slide 1: http://www.flickr.com/photos/39057386@N02/4111291263/
Slide 3 (Chrome): http://news.cnet.com/8301-30685_3...
Why meteor
Why meteor
Why meteor
Why meteor
Why meteor
Why meteor
Upcoming SlideShare
Loading in …5
×

Why meteor

1,998 views
1,868 views

Published on

Why should use meteor to build an application?

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,998
On SlideShare
0
From Embeds
0
Number of Embeds
33
Actions
Shares
0
Downloads
23
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • Javascript is / was the only ubiquitous language on the browser. Probably because it came out so long ago

    However javascript used to be very slow

    Noticeably slow on the client / so servers would render html templates and then send them to the client (page reloads or ajax)

    Too slow to use if you want to have a performant server
  • Then along Chrome and the V8 javascript engine

    Fast new generation of Javascript engines gave the client far more power for user experience.

    Along with the HTML5 spec’s new features, they basically replaced need for plugins (like Flash and Sliverlight)
  • V8 is so fast, that it enables us to use Javascript on the server.

    Node, which runs off v8 engine is a server side Javascript framework.

    It was invented by Ryan Dahl because he wanted to built web sites with push capabilities like Gmail (or chat application).

    Many of the current programming frameworks allowed for async code, but it is difficult to use.

    So he build Node, to bake non-blocking IO into the server from the ground up.

    What does that all mean?

    ------

    History of Node: http://www.youtube.com/watch?v=SAc0vQCC6UQ
  • First one either

    Blocks entire process
    Implies multiple execution stacks
    Complicated manage locks on shared data
    Threads are expensive

    Second one is non-blocking, so it can run on an event loop.

    Javascript’s feature’s were built for an event loop, things like callbacks and closures. The browser runs javascript in an event loop. So it is non-blocking from the ground up.

    ----
    From original Node.js presentation http://www.youtube.com/watch?v=ztspvPYybIY
  • Traditional server, if you make a request then access the database or some other services, the thread will stay blocked until your IO operations are completed.

    This does not scale well when you are doing long polling and have 1000s of connections.
  • Node fixes that with it’s event loop and non-blocking IO.

    Since JavaScript did not have an existing I/O api, he was able to build a non-blocking, event driven I/O convention into it from the ground up.

    It’s actually hard to write blocking code with node.
  • 1 language = keep it simple
  • We get simplicity. This is the main reason we are using meteor / node in this class.

    - Get proficient with one language then reuse your skillset on the client and server

    Reuse code client & server

    Javascript is the most popular language, at least on GitHub. So you can reuse a lot of other people’s code
  • Old internet formula for success
  • How do you leverage the power of javascript on the client and javascript on the server?
  • Meteor is a platform built on top of Node.js for building real-time web apps of 2014.
  • Google, facebook, and twitter have set the bar for people to expect real time, rich applications.

    - Meteor is the platform rails would be if it were built today on top of node.

    - Allow you to use JavaScript on the client and on the server. Can share code between both environments.

    - Very powerful and very simple platform that abstracts away many of the usual hassles and pitfalls of web app development.

    - In other frameworks real-time is hard. Meteor makes it easy.

    But don’t take my word for it.
  • Consulting companies love it

    Differential.io
    percolatestudio.com
  • And so do startups

    respond.ly
    https://www.youtube.com/watch?v=jscINbvWoDg
  • https://lookback.io/
  • Our company, Structural is built in meteor. Details coming soon….
  • DDP protocol allows anything to connect to Meteor -- from native mobile apps to Arduinos.

    DDP clients are available in Android, Objective C, Java, C#, Python, Ruby, Dart, AS3… http://www.meteorpedia.com/read/DDP_Clients
  • http://nodejs.org/download/
  • .meteor/ used by Meteor

    .meteor/packages and .meteor/release files are the only two we will modify, but not today

    /lib loaded first

    main.* file is loaded last
  • To summarize
  • Why meteor

    1. 1. & Getting Started Meteor + Getting Started @jon_perl
    2. 2. 1. Use JavaScript on the client (since 1995)
    3. 3. Blocking / Threads vs Callbacks var result = db.query(“select * from T”) print(result) db.query(“select * from T”, function (result) { print(result) }) vs
    4. 4. Traditional Server
    5. 5. Node
    6. 6. 1. Use JavaScript on the client 2. Use JavaScript on the server
    7. 7. One language to rule them all
    8. 8. 1. Use JavaScript on the client 2. Use JavaScript on the server 3. ??? 4. PROFIT!
    9. 9. ???
    10. 10. Meteor
    11. 11. The web in 2014 • Rich applications – Real time updates – Single page • Short development cycles
    12. 12. Seven Principles of Meteor Data on the Wire. Send data, not HTML, over the network. Let the client decide how to render it. One Language. Write both the client and the server parts of your interface in JavaScript. Database Everywhere. Use the same transparent API to access your database from the client or the server. Latency Compensation. On the client, use prefetching and model simulation to make it look like you have a zero-latency connection to the database.
    13. 13. Seven Principles of Meteor Full Stack Reactivity. Make realtime the default. All layers, from database to template, should make an event-driven interface available. Embrace the Ecosystem. Meteor is open source and integrates, rather than replaces, existing open source tools and frameworks. Simplicity Equals Productivity. The best way to make something seem simple is to have it actually be simple. Accomplish this through clean, classically beautiful APIs.
    14. 14. Getting Started Install Node and Meteor (Mac / Linux) curl https://install.meteor.com | /bin/sh (Windows) http://win.meteor.com/
    15. 15. 1. Create an example 2. Run the app
    16. 16. File Structure • /server - runs on the server • /client - runs on the client • /, /common - runs on both • static assets (fonts, images, etc.) go in /public
    17. 17. Additional Resources https://www.discovermeteor.com/ https://eventedmind.com/ http://meteorpedia.com/ http://docs.meteor.com http://manual.meteor.com/
    18. 18. 1. Use JavaScript on the client 2. Use JavaScript on the server 3. Meteor 4. PROFIT!
    19. 19. Questions?
    20. 20. Credits Slide 1: http://www.flickr.com/photos/39057386@N02/4111291263/ Slide 3 (Chrome): http://news.cnet.com/8301-30685_3-20043680-264.html Slide 3 & 4 (V8): http://news.softpedia.com/newsImage/Chrome-May-Add-Support-for-Mozilla-s-Asm-js- the-Native-Client-Competitor-2.png Slide 4 (Node): http://www.codersgrid.com/wp-content/uploads/2013/05/nodejs-image-processing.png Slide 5 & 6: http://magnetik.github.io/node-webid-report/ Slide 8: http://www.flickr.com/photos/87408548@N02/9102201081/ Slide 11: http://www.flickr.com/photos/10017016@N03/4885254343/

    ×