3. Key Principles
Data on the Wire. Don't send HTML over the network.
Send data and let the client decide how to render it.
Full Stack Reactivity. Make realtime the default.
All layers event-driven.
Simple and Open
http://docs.meteor.com/#sevenprinciples
4. Single Page
Focus is on intuitive UX
Clean, single page
Simple interactions
Highly interconnected
Socially networked
Mashup paradise
Simple collaboration platform
5. Reactive
• Templated views
• Application reacts to
– User actions
– Data actions
– Remote actions
• „Synchronisation‟ is automatic
– No transport code needed
David Glasser in Chicago - Meteor: Past, Present, & Future:
http://youtu.be/r996yhHNs5k?t=11m27s
6. Realtime
• Fetches from MongoDB after every
operation
– Pushes relevant updates to any subscribed
client
• Uses fairly sophisticated algorithm to determine
what to fetch and for whom.
– Also polls every 10 seconds
• Mongo oplog when >= Meteor 0.7.0
7. Session
• Session is per-tab
– sticky session
• Session is retained on hot-code reload,
but not on manual refresh (can cause
testing issues)
• Session stays open for ~15 minutes
(memory on server) after socket closes
10. Application Structure
• Simple structure
• Client/server separate files
– but share most functional code
• Publish on server and Subscribe on client
• Templated views
• MongoDB backend
– Can access others via packages
– Flexible nosql data source
• Backend is very efficient with Fibers
11. Quickstart
// install
$ curl https://install.meteor.com/ | sh
// create project
$ meteor create TestApp
// run
$ cd TestApp
$ meteor
=> Meteor server running on:
localhost:3000
//deploy
$ meteor deploy TestApp.meteor.com
12. Highly Recommended
// create project
$ meteor create TestApp
$ cd TestApp
// secure the project
meteor remove insecure
meteor remove autopublish
// run
$ meteor
=> Meteor server running………
13. Suggested
$ mkdir server //Only loads on
$ mkdir client //Only loads on
$ mkdir public //Static assets
$ mkdir shared //Loads on both
anything else not in server or
folder)
server
client
(as will
client
• Move (or remove) the premade files
– They sort of suck
– maybe want templates/views folder too
16. Binding Events
Chris Mather: Understanding the Event Loop, Async and Fibers:
http://www.youtube.com/watch?v=AWJ8LIzQMHY
http://stackoverflow.com/a/20794175/1358220
20. Package Management
• Meteorite
– Smart packages manager
– Several router choices
– Installs from atmosphere.meteor.com
• Can use NPM packages
– But may require some custom wrappers
• Much better towards 1.0
21. Challenges
• Good habits in old models, sometimes fail
you under Meteor
– Centralised data model
– Flow is different
• Some developers prefer the old model
– Break out!
– Don‟t force MVC or „tack on‟ an extra DAL, let
the engine to do the work for you
22. Into Production
•
•
•
•
•
Setup an appropriate file structure
Check your Allow/Deny rules
Check what code is shared/private
Expect change
Optimise Performance
– Essentially Node under the hood, though
some caveats apply (sticky sessions)
Ritik Malhotra: Building a Production-Ready Meteor App:
http://www.youtube.com/watch?v=gfFGjmiKfnA
23. Performance
• Not great with static assets, use a CDN and/or static cache if
scaling big
• Wrap source/subscriptions for logged-in and anonymous
users differently
– Each subscription requires resources
• Use {{#constant}}...{{/constant}} in templates around static
content
• {“_id”: “abc123”} is very fast when query/update Collection
http://meteorhacks.com/does-meteor-scale.html
http://projectricochet.com/blog/
24. Coming Up
• 1.0 expected soon (any day)
• Newer, faster render engine
• Many more packages appearing
• Students/kids are learning with Meteor
• Lots of startups use it for simple products
25. So, what is Meteor?
• Highly interactive and interconnected
• Realtime, reactive
• Templated simple user
interface/experience
• Accessible and manageable code
– no callback soup
• Scalable and performant
• Getting more awesome every day :)
26. Thank You :)
How can you benefit
from Meteor?
Bob Davies
IndieSpring / Imba Software
Twitter/Skype @bobbigmac
Facebook /bobdavies
Blog: http://bobbigmac.com
Notes de l'éditeur
A surprising amount of people don’t know to do this. Mad.
A surprising amount of people don’t know to do this. Mad.
A surprising amount of people don’t know to do this. Mad.
A surprising amount of people don’t know to do this. Mad.
A surprising amount of people don’t know to do this. Mad.
A surprising amount of people don’t know to do this. Mad.
A surprising amount of people don’t know to do this. Mad.