• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Meteor node upnorth-bobdavies
 

Meteor node upnorth-bobdavies

on

  • 551 views

 

Statistics

Views

Total Views
551
Views on SlideShare
175
Embed Views
376

Actions

Likes
1
Downloads
2
Comments
0

2 Embeds 376

http://nodeupnorth.co.uk 241
http://www.nodeupnorth.co.uk 135

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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.

Meteor node upnorth-bobdavies Meteor node upnorth-bobdavies Presentation Transcript

  • Meteor Rock your world Bob Davies IndieSpring / Imba Software
  • What is Meteor? Principles What it actually does How it works (101) http://docs.meteor.com/
  • 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
  • Single Page Focus is on intuitive UX Clean, single page Simple interactions Highly interconnected Socially networked Mashup paradise Simple collaboration platform
  • 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
  • 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
  • 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
  • Comparison Several Thousand lines of code (php + jQuery) Hard to build AND to use
  • TENs of lines of code Very EASY to build AND use
  • 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
  • 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
  • Highly Recommended // create project $ meteor create TestApp $ cd TestApp // secure the project meteor remove insecure meteor remove autopublish // run $ meteor => Meteor server running………
  • 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
  • Publish/Subscribe
  • Templating
  • Binding Events Chris Mather: Understanding the Event Loop, Async and Fibers: http://www.youtube.com/watch?v=AWJ8LIzQMHY http://stackoverflow.com/a/20794175/1358220
  • Allow / Deny
  • What to build? • Slick UI/UX • Socially Integrated • Collaborative Meteor meets Phonegap with Verso: http://youtu.be/eeY1mZhvDy4?t=6m30s http://madewith.meteor.com/ https://www.meteor.com/blog/2014/01/03/6-must-see-meteor-talks-from-2013
  • Useful built in packages
  • 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
  • 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
  • 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
  • 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/
  • 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
  • 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 :)
  • Thank You :) How can you benefit from Meteor? Bob Davies IndieSpring / Imba Software Twitter/Skype @bobbigmac Facebook /bobdavies Blog: http://bobbigmac.com