SlideShare a Scribd company logo
Node.js
     &
Mobile Apps

        Richard Rodger
        @rjrodger
        nearform.com
•Why should you use Node.js?
•Node.js basics
•Lessons from a real world project
nodejs.org




• Code in JavaScript on the server
• Built using Chrome V8 Engine - so it's really fast!
• Everything is event-based; there are no threads
Node.js Web Server
var http = require('http');

var server = http.createServer( function(req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'})
  res.end('Hello Worldn')
});

server.listen(80, '127.0.0.1');

console.log('Web server running at http://127.0.0.1:80');
why?
there are
three
eras...

            1990's
               2000's
                   2010's
"keep your job"    Node.js is
   languages      the platform




                           * yes I know about tiobe.com
how many
concurrent
  clients?

     90's: 10
       00's: 100
           10's: 1000
                 C10K Problem
How do
you scale?


      processes
        threads
           events
JavaScript: the world's ugliest language


      avoid slow, validate forms
        date ECMA, jQuery
           marry Node.js, Crockford
Where
will your
app live?

     co-lo buy, build, and rack
       IaaS Amazon EC2
          PaaS Heroku
Don't
Forget the
  Web

browser wars
  web 2.0
    standardise!
Mobile
            Hybrid      Native
  Web
           HTML5/JS   Gotta learn 'em all*
HTML5/JS
Mobile Web Apps

•   Web Pages built using HTML5 features:
    •   Canvas for drawing
    •   In-built Video and Audio
    •   Geolocation
    •   Web Sockets
    •   Local Storage, Local Caching
    •   CSS3 transitions (not really HTML5)
•   Use JavaScript as main programming language
                                                        ft.com        business
•   Designed for Touch Interfaces
                                                                       post.ie
    •   Smart phone or Tablet form factors
    •   Don’t use Hover effects, instead convey touch affordance using 3D styling
•   Dynamic single page apps. Changes are made to the HTML rather than loading
    new pages.
Mobile Web Standards Compliance

Latest Versions      Storage               CSS3               Mobile              Multimedia
                     local, cache, sql    effects, 2D, 3D   touch, geo & motion     video & audio




      iOS          ★★★ ★★★ ★★★                                                     ★★

   Android         ★★★ ★★★ ★★★                                                         ★
  Win Ph. 7              ★               ★★                       ★                    ★
BlackBerry 6+        ★★                  ★★                   ★★                       ★
   Legacy
   recent Nokias         ★                    ★                   ★

                                     mobilehtml5.org
Node.js and Mobile
                           nginx                 Node.js


• nginx
 • high performance web server
    • serves static resources: test files, images
    • proxies requests through to Node.js app server
• Node.js
 • high performance server-side JavaScript
 • Executes business logic and database queries
• Runs high-performance server-side JavaScript
 • open source, sponsored by joyent.com
• Uses the Google Chrome V8 engine
 • just-in-time compilation to machine code
 • generation garbage collection (like the Java JVM)
 • creates virtual “classes” to optimise property lookups
• Has a well-designed module system for third party code - very
   effective and simple to use
• Your code runs in a single non-blocking JavaScript thread
• That’s OK, most of the time you’re waiting for database or
   network events
being event-driven is like
having a butler run your
server
Your code runs in one thread only!
Working with Events
  var http = require('http');
  var server = http.createServer();

  server.on( 'request', function(req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'})

       var echo = ''
       req.on('data',function(chunk){
          echo += chunk
       })

       req.on('end', function(){
          res.end( echo+'n' )
       })

       req.on('error', function(err){
          res.end( "error: "+err )
       })
  })

  server.listen(80, '127.0.0.1');
  console.log('try: curl http://127.0.0.1 -d hello');
What does the core API give you?




   Q
   basics:
   file system, ...
                        9
                       control:
                       events, streams, buffers...



   g
   networking:
   sockets, DNS, ...
                        „
                       web server:
                       HTTP handling, ...
Node.js modules are so cool

• Easy syntax
 • var moduleAPI = require("modulename");
• Central repository
 • npmjs.org
• Easy command line install
 • npm install modulename
• No version conflicts!
 • intelligent dependency management
• Declarative project description
 •   package.json file goes into project root folder
Some important modules
(find them on npmjs.org or github.com)
• connect
 • HTTP middleware infrastructure - requests pass through layers
• express
 • JSP/ASP style dynamic server-side pages
• underscore
 • same as client-side library! provides functional utilities: map, reduce, ...
• socket.io
 • HTML5 real-time web sockets that "just work" - includes client-side API
• request
 • easy outbound calls to web services
Node.js is                         It doesn't
overhyped                          matter
 • Not a clear winner against       •   Chrome V8 Engine means
                                        Node.js is "Good Enough"
    other event servers on speed

 • Asynchronous code is harder      •   JavaScript means almost all
                                        libraries are asynchronous, unlike
    than synchronous code               other event servers
 • No, you wont re-use much         •   JavaScript is a local maximum and
    code between client and             you're stuck with it
    server
                                    •   Same language on client and
                                        server makes your brain happy
 • Memory can still leak
                                    •   Compile to JavaScript if you really
 • It's not a mature platform           hate the language
businesspost.ie
Web
 Mobile                     Cloud
              Services
Web Apps                   Services
                API


 Mobile &       REST &
                            Database
Tablet Web       JSON

 Mobile &     Horizontal   Third Party
Tablet Apps     Scale       Services

 Desktop       Cloud
                           Monitoring
  Web          Hosted
Client-side
 Router    #! URLs
                             • Common code-base
                              • even for hybrid apps!
 Models    Data, biz logic
                             • backbone.js
                             • shims for weak browsers
  Views    DOM Layout
                             • browser-targeting: user-
                               agent & capabilities

                             • responsive layout
                               (mostly)
 Helpers   Shared code
Server-side
             map /api/ URLs       • nginx & Node.js
  Router
             to functions         • Small code volume
    API      function( req,       • Third party modules:
 functions   res ) { ... }         • connect
             Shared code
                                   • express
 Helpers     (some with client)    • seneca (my db layer)
             Open source
                                  • Deploy with:
 Modules     heavy-lifting         • sudo killall node
Cloud Services
Database    Hosting    Monitors



MongoDB     Amazon      Amazon

             Load
  Redis                cloudkick
            Balancer

            Instance
memcached              Continuous
             Scaling
Third Party Integration
JSON, XML, simple form data, text files, ...
  ... all easy using JavaScript and Node.js Modules


    Analytics          Twitter        E-Commerce

                                         In-App
     Logging          Facebook
                                       Purchasing

      Email           LinkedIn         Stock Feed
Native Apps
Same code as mobile web versions, ...
 ... wrapped using PhoneGap to run natively
 ... plus some native plugins
Lesson:
Lesson:
               code volume
4

3

2

1

0
    Client JavaScript   Server JavaScript
Lesson:
multi-platform client-side JavaScript is really hard

 • a framework is a must           • code against ECMA, use shims
                                      to support older browsers
  • backbone.js                    • Code/Test/Debug inside Safari
 • business logic must be in       • phonegap.github.com/weinre
    common code                       for hard to reach places
 • browser-specific code        • use error capture in production
  • virtual .js files           • Finally, use a simple static site as
                                 a fallback (also for Googlebot)
 • use jshint to keep IE happy
Lesson:
multi-platform HTML/CSS is really hard

 • "structured" CSS is a must   • Clean, semantic HTML is not
                                   optional
  • sass or less                 • graceful degradation may
 • Be happy with                     require radically different CSS

  • media queries               • 100% "Responsive" design is
                                   tough
  • CSS3 transforms              • Responsive within browser
                                     subsets has higher reward/
 • browser-specific code              effort

  • virtual .css files
Lesson:
the app stores are not web sites

 • that bug in version 1... • you can't deploy hot fixes
  • will take two weeks to • make everything
     fix via an update          configurable!

   • some users will never    • All prices, text, host
     update                      names, urls, ...

   • appears after an OS     • On launch, app "checks-in"
     update                    for new configuration

                              • this will save your life
Lesson:
Node.js does what it says on the tin

 • High performance             • callback spaghetti is not a
                                   problem in practice
 • High throughput
 • Low CPU usage                  • use functional style
 • Constant memory usage          • client-side code is far
                                      more difficult
  • leaks will kill, but then   • Don't do CPU intensive stuff
 • < 100ms startup time          • ... there's a warning on
  • means you may not                 the tin!
       notice!
Lesson:
Outsource your database

 • Remote MongoDB              • Big productivity gain
   hosting
                                • no production tuning
  • mongohq.com                 • no configuration
 • No downtime                  • no cluster set up
 • Backups
 • Low latency (in Amazon)
 • Web-based admin (if lazy)
Node.js means Rapid Development




                                    * Bruno Fernandez-Ruiz
                          http://www.olympum.com/architecture/the-
                                  nodejs-innovation-advantage/
My Company
Mobile Apps + Node.js



My Book
richardrodger.com



Richard Rodger
@rjrodger
nearform.com

More Related Content

What's hot

Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
drupalcampest
 
Node.js, toy or power tool?
Node.js, toy or power tool?Node.js, toy or power tool?
Node.js, toy or power tool?Ovidiu Dimulescu
 
Joshfire factory: Using NodeJS in production
Joshfire factory: Using NodeJS in productionJoshfire factory: Using NodeJS in production
Joshfire factory: Using NodeJS in production
Steren Giannini
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
philogb
 
8 Most Effective Node.js Tools for Developers
8 Most Effective Node.js Tools for Developers8 Most Effective Node.js Tools for Developers
8 Most Effective Node.js Tools for Developers
iMOBDEV Technologies Pvt. Ltd.
 
Node js projects
Node js projectsNode js projects
Node js projects
💾 Radek Fabisiak
 
Building Real World Application with Azure
Building Real World Application with AzureBuilding Real World Application with Azure
Building Real World Application with Azure
divyapisces
 
The Dark Side of Single Page Applications
The Dark Side of Single Page ApplicationsThe Dark Side of Single Page Applications
The Dark Side of Single Page Applications
Dor Kalev
 
Javascript fatigue, 자바스크립트 피로
Javascript fatigue, 자바스크립트 피로Javascript fatigue, 자바스크립트 피로
Javascript fatigue, 자바스크립트 피로
Rhio Kim
 
CQ5 and Sling overview
CQ5 and Sling overviewCQ5 and Sling overview
CQ5 and Sling overview
Bertrand Delacretaz
 
Meanstack overview
Meanstack overviewMeanstack overview
Meanstack overview
Adthasid Sabmake
 
Mini-Training: Node.js
Mini-Training: Node.jsMini-Training: Node.js
Mini-Training: Node.js
Betclic Everest Group Tech Team
 
Varna conf nodejs-oss-microsoft-azure[final]
Varna conf nodejs-oss-microsoft-azure[final]Varna conf nodejs-oss-microsoft-azure[final]
Varna conf nodejs-oss-microsoft-azure[final]
Mihail Mateev
 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1James Pearce
 
"Building Cross-platform Without Sacrificing Performance" by Simon Sturmer (K...
"Building Cross-platform Without Sacrificing Performance" by Simon Sturmer (K..."Building Cross-platform Without Sacrificing Performance" by Simon Sturmer (K...
"Building Cross-platform Without Sacrificing Performance" by Simon Sturmer (K...
Tech in Asia ID
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDB
Valeri Karpov
 
Javantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornJavantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornMiroslav Resetar
 
Flu3nt highlights
Flu3nt highlightsFlu3nt highlights
Flu3nt highlightsdswork
 
Threads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionThreads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java edition
Ovidiu Dimulescu
 
Building an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stackBuilding an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stack
divyapisces
 

What's hot (20)

Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
Node.js, toy or power tool?
Node.js, toy or power tool?Node.js, toy or power tool?
Node.js, toy or power tool?
 
Joshfire factory: Using NodeJS in production
Joshfire factory: Using NodeJS in productionJoshfire factory: Using NodeJS in production
Joshfire factory: Using NodeJS in production
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
8 Most Effective Node.js Tools for Developers
8 Most Effective Node.js Tools for Developers8 Most Effective Node.js Tools for Developers
8 Most Effective Node.js Tools for Developers
 
Node js projects
Node js projectsNode js projects
Node js projects
 
Building Real World Application with Azure
Building Real World Application with AzureBuilding Real World Application with Azure
Building Real World Application with Azure
 
The Dark Side of Single Page Applications
The Dark Side of Single Page ApplicationsThe Dark Side of Single Page Applications
The Dark Side of Single Page Applications
 
Javascript fatigue, 자바스크립트 피로
Javascript fatigue, 자바스크립트 피로Javascript fatigue, 자바스크립트 피로
Javascript fatigue, 자바스크립트 피로
 
CQ5 and Sling overview
CQ5 and Sling overviewCQ5 and Sling overview
CQ5 and Sling overview
 
Meanstack overview
Meanstack overviewMeanstack overview
Meanstack overview
 
Mini-Training: Node.js
Mini-Training: Node.jsMini-Training: Node.js
Mini-Training: Node.js
 
Varna conf nodejs-oss-microsoft-azure[final]
Varna conf nodejs-oss-microsoft-azure[final]Varna conf nodejs-oss-microsoft-azure[final]
Varna conf nodejs-oss-microsoft-azure[final]
 
HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1HTML5 and the dawn of rich mobile web applications pt 1
HTML5 and the dawn of rich mobile web applications pt 1
 
"Building Cross-platform Without Sacrificing Performance" by Simon Sturmer (K...
"Building Cross-platform Without Sacrificing Performance" by Simon Sturmer (K..."Building Cross-platform Without Sacrificing Performance" by Simon Sturmer (K...
"Building Cross-platform Without Sacrificing Performance" by Simon Sturmer (K...
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDB
 
Javantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript NashornJavantura 2014 - Java 8 JavaScript Nashorn
Javantura 2014 - Java 8 JavaScript Nashorn
 
Flu3nt highlights
Flu3nt highlightsFlu3nt highlights
Flu3nt highlights
 
Threads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java editionThreads Needles Stacks Heaps - Java edition
Threads Needles Stacks Heaps - Java edition
 
Building an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stackBuilding an E-commerce website in MEAN stack
Building an E-commerce website in MEAN stack
 

Viewers also liked

Conseils pour un jeune diabétique 1
Conseils pour un jeune diabétique 1Conseils pour un jeune diabétique 1
Conseils pour un jeune diabétique 1
dptofra
 
Richardrodger microxchgio-feb-2015-final
Richardrodger microxchgio-feb-2015-finalRichardrodger microxchgio-feb-2015-final
Richardrodger microxchgio-feb-2015-final
Richard Rodger
 
Richardrodger nodeday-2014-final
Richardrodger nodeday-2014-finalRichardrodger nodeday-2014-final
Richardrodger nodeday-2014-final
Richard Rodger
 
Business Communication
Business CommunicationBusiness Communication
Business Communicationmoiz701
 

Viewers also liked (6)

Conseils pour un jeune diabétique 1
Conseils pour un jeune diabétique 1Conseils pour un jeune diabétique 1
Conseils pour un jeune diabétique 1
 
20120514 nodejsdublin
20120514 nodejsdublin20120514 nodejsdublin
20120514 nodejsdublin
 
20120816 nodejsdublin
20120816 nodejsdublin20120816 nodejsdublin
20120816 nodejsdublin
 
Richardrodger microxchgio-feb-2015-final
Richardrodger microxchgio-feb-2015-finalRichardrodger microxchgio-feb-2015-final
Richardrodger microxchgio-feb-2015-final
 
Richardrodger nodeday-2014-final
Richardrodger nodeday-2014-finalRichardrodger nodeday-2014-final
Richardrodger nodeday-2014-final
 
Business Communication
Business CommunicationBusiness Communication
Business Communication
 

Similar to 20120802 timisoara

Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
Khaled Mosharraf
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
JITENDRA KUMAR PATEL
 
Phonegap for Engineers
Phonegap for EngineersPhonegap for Engineers
Phonegap for EngineersBrian LeRoux
 
Web technologies for desktop development @ berlinjs apps
Web technologies for desktop development @ berlinjs appsWeb technologies for desktop development @ berlinjs apps
Web technologies for desktop development @ berlinjs appsDarko Kukovec
 
Building Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsBuilding Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsAndrew Ferrier
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Mark Leusink
 
Windows Phone 7 and Windows Azure – A Match Made in the Cloud
Windows Phone 7 and Windows Azure – A Match Made in the CloudWindows Phone 7 and Windows Azure – A Match Made in the Cloud
Windows Phone 7 and Windows Azure – A Match Made in the CloudMichael Collier
 
Linkedinmobile 111011223417-phpapp02
Linkedinmobile 111011223417-phpapp02Linkedinmobile 111011223417-phpapp02
Linkedinmobile 111011223417-phpapp02htdvul
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
visual28
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
IT Arena
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
Kasey McCurdy
 
Offience's Node showcase
Offience's Node showcaseOffience's Node showcase
Offience's Node showcase
cloud4le
 
Women Who Code, Ground Floor
Women Who Code, Ground FloorWomen Who Code, Ground Floor
Women Who Code, Ground Floor
Katie Weiss
 
Real-world Dojo Mobile
Real-world Dojo MobileReal-world Dojo Mobile
Real-world Dojo MobileAndrew Ferrier
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
Nicola Del Gobbo
 
Mean stack
Mean stackMean stack
Mean stack
RavikantGautam8
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
Habilelabs
 

Similar to 20120802 timisoara (20)

Beginners Node.js
Beginners Node.jsBeginners Node.js
Beginners Node.js
 
Introduction to node.js aka NodeJS
Introduction to node.js aka NodeJSIntroduction to node.js aka NodeJS
Introduction to node.js aka NodeJS
 
Phonegap for Engineers
Phonegap for EngineersPhonegap for Engineers
Phonegap for Engineers
 
Web technologies for desktop development @ berlinjs apps
Web technologies for desktop development @ berlinjs appsWeb technologies for desktop development @ berlinjs apps
Web technologies for desktop development @ berlinjs apps
 
Node
NodeNode
Node
 
Building Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsBuilding Real-World Dojo Web Applications
Building Real-World Dojo Web Applications
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
Windows Phone 7 and Windows Azure – A Match Made in the Cloud
Windows Phone 7 and Windows Azure – A Match Made in the CloudWindows Phone 7 and Windows Azure – A Match Made in the Cloud
Windows Phone 7 and Windows Azure – A Match Made in the Cloud
 
Linkedinmobile 111011223417-phpapp02
Linkedinmobile 111011223417-phpapp02Linkedinmobile 111011223417-phpapp02
Linkedinmobile 111011223417-phpapp02
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
Meetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech PeopleMeetup. Technologies Intro for Non-Tech People
Meetup. Technologies Intro for Non-Tech People
 
Firefox OS Weekend
Firefox OS WeekendFirefox OS Weekend
Firefox OS Weekend
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
Offience's Node showcase
Offience's Node showcaseOffience's Node showcase
Offience's Node showcase
 
Women Who Code, Ground Floor
Women Who Code, Ground FloorWomen Who Code, Ground Floor
Women Who Code, Ground Floor
 
Javascript for Wep Apps
Javascript for Wep AppsJavascript for Wep Apps
Javascript for Wep Apps
 
Real-world Dojo Mobile
Real-world Dojo MobileReal-world Dojo Mobile
Real-world Dojo Mobile
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
 
Mean stack
Mean stackMean stack
Mean stack
 
Top 10 frameworks of node js
Top 10 frameworks of node jsTop 10 frameworks of node js
Top 10 frameworks of node js
 

More from Richard Rodger

Using RAG to create your own Podcast conversations.pdf
Using RAG to create your own Podcast conversations.pdfUsing RAG to create your own Podcast conversations.pdf
Using RAG to create your own Podcast conversations.pdf
Richard Rodger
 
Richard_TheDev2023_pattern.pptx.pdf
Richard_TheDev2023_pattern.pptx.pdfRichard_TheDev2023_pattern.pptx.pdf
Richard_TheDev2023_pattern.pptx.pdf
Richard Rodger
 
richard-rodger-awssofia-microservices-2019.pdf
richard-rodger-awssofia-microservices-2019.pdfrichard-rodger-awssofia-microservices-2019.pdf
richard-rodger-awssofia-microservices-2019.pdf
Richard Rodger
 
richardrodger-microservice-algebra-cluj-apr.pdf
richardrodger-microservice-algebra-cluj-apr.pdfrichardrodger-microservice-algebra-cluj-apr.pdf
richardrodger-microservice-algebra-cluj-apr.pdf
Richard Rodger
 
richardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdfrichardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdf
Richard Rodger
 
richardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdfrichardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdf
Richard Rodger
 
richardrodger-microservice-risk-dublin-mar.pdf
richardrodger-microservice-risk-dublin-mar.pdfrichardrodger-microservice-risk-dublin-mar.pdf
richardrodger-microservice-risk-dublin-mar.pdf
Richard Rodger
 
richardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdfrichardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdf
Richard Rodger
 
richardrodger-vespa-waterford-oct.pdf
richardrodger-vespa-waterford-oct.pdfrichardrodger-vespa-waterford-oct.pdf
richardrodger-vespa-waterford-oct.pdf
Richard Rodger
 
Richardrodger designing-microservices-uxdx-dublin-oct
Richardrodger designing-microservices-uxdx-dublin-octRichardrodger designing-microservices-uxdx-dublin-oct
Richardrodger designing-microservices-uxdx-dublin-oct
Richard Rodger
 
How microservices fail, and what to do about it
How microservices fail, and what to do about itHow microservices fail, and what to do about it
How microservices fail, and what to do about it
Richard Rodger
 
Rapid Digital Innovation: How Node.js Delivers
Rapid Digital Innovation: How Node.js DeliversRapid Digital Innovation: How Node.js Delivers
Rapid Digital Innovation: How Node.js Delivers
Richard Rodger
 
Richardrodger nodeconfeu-2014-final
Richardrodger nodeconfeu-2014-finalRichardrodger nodeconfeu-2014-final
Richardrodger nodeconfeu-2014-final
Richard Rodger
 
Richardrodger nodeday-2014-final
Richardrodger nodeday-2014-finalRichardrodger nodeday-2014-final
Richardrodger nodeday-2014-final
Richard Rodger
 
Micro-services Battle Scars
Micro-services Battle ScarsMicro-services Battle Scars
Micro-services Battle Scars
Richard Rodger
 
Richard rodger technical debt - web summit 2013
Richard rodger   technical debt - web summit 2013Richard rodger   technical debt - web summit 2013
Richard rodger technical debt - web summit 2013
Richard Rodger
 
The Seneca Pattern at EngineYard Distill 2013 Conference
The Seneca Pattern at EngineYard Distill 2013 ConferenceThe Seneca Pattern at EngineYard Distill 2013 Conference
The Seneca Pattern at EngineYard Distill 2013 Conference
Richard Rodger
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.jsRichard Rodger
 
How to Write Big Apps (Richard Rodger NodeDublin 2012)
How to Write Big Apps (Richard Rodger NodeDublin 2012)How to Write Big Apps (Richard Rodger NodeDublin 2012)
How to Write Big Apps (Richard Rodger NodeDublin 2012)Richard Rodger
 
Richard rodger-appgen-2012-lxjs-lisbon
Richard rodger-appgen-2012-lxjs-lisbonRichard rodger-appgen-2012-lxjs-lisbon
Richard rodger-appgen-2012-lxjs-lisbonRichard Rodger
 

More from Richard Rodger (20)

Using RAG to create your own Podcast conversations.pdf
Using RAG to create your own Podcast conversations.pdfUsing RAG to create your own Podcast conversations.pdf
Using RAG to create your own Podcast conversations.pdf
 
Richard_TheDev2023_pattern.pptx.pdf
Richard_TheDev2023_pattern.pptx.pdfRichard_TheDev2023_pattern.pptx.pdf
Richard_TheDev2023_pattern.pptx.pdf
 
richard-rodger-awssofia-microservices-2019.pdf
richard-rodger-awssofia-microservices-2019.pdfrichard-rodger-awssofia-microservices-2019.pdf
richard-rodger-awssofia-microservices-2019.pdf
 
richardrodger-microservice-algebra-cluj-apr.pdf
richardrodger-microservice-algebra-cluj-apr.pdfrichardrodger-microservice-algebra-cluj-apr.pdf
richardrodger-microservice-algebra-cluj-apr.pdf
 
richardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdfrichardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdf
 
richardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdfrichardrodger-designing-microservices-london-may.pdf
richardrodger-designing-microservices-london-may.pdf
 
richardrodger-microservice-risk-dublin-mar.pdf
richardrodger-microservice-risk-dublin-mar.pdfrichardrodger-microservice-risk-dublin-mar.pdf
richardrodger-microservice-risk-dublin-mar.pdf
 
richardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdfrichardrodger-service-discovery-waterford-feb.pdf
richardrodger-service-discovery-waterford-feb.pdf
 
richardrodger-vespa-waterford-oct.pdf
richardrodger-vespa-waterford-oct.pdfrichardrodger-vespa-waterford-oct.pdf
richardrodger-vespa-waterford-oct.pdf
 
Richardrodger designing-microservices-uxdx-dublin-oct
Richardrodger designing-microservices-uxdx-dublin-octRichardrodger designing-microservices-uxdx-dublin-oct
Richardrodger designing-microservices-uxdx-dublin-oct
 
How microservices fail, and what to do about it
How microservices fail, and what to do about itHow microservices fail, and what to do about it
How microservices fail, and what to do about it
 
Rapid Digital Innovation: How Node.js Delivers
Rapid Digital Innovation: How Node.js DeliversRapid Digital Innovation: How Node.js Delivers
Rapid Digital Innovation: How Node.js Delivers
 
Richardrodger nodeconfeu-2014-final
Richardrodger nodeconfeu-2014-finalRichardrodger nodeconfeu-2014-final
Richardrodger nodeconfeu-2014-final
 
Richardrodger nodeday-2014-final
Richardrodger nodeday-2014-finalRichardrodger nodeday-2014-final
Richardrodger nodeday-2014-final
 
Micro-services Battle Scars
Micro-services Battle ScarsMicro-services Battle Scars
Micro-services Battle Scars
 
Richard rodger technical debt - web summit 2013
Richard rodger   technical debt - web summit 2013Richard rodger   technical debt - web summit 2013
Richard rodger technical debt - web summit 2013
 
The Seneca Pattern at EngineYard Distill 2013 Conference
The Seneca Pattern at EngineYard Distill 2013 ConferenceThe Seneca Pattern at EngineYard Distill 2013 Conference
The Seneca Pattern at EngineYard Distill 2013 Conference
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.js
 
How to Write Big Apps (Richard Rodger NodeDublin 2012)
How to Write Big Apps (Richard Rodger NodeDublin 2012)How to Write Big Apps (Richard Rodger NodeDublin 2012)
How to Write Big Apps (Richard Rodger NodeDublin 2012)
 
Richard rodger-appgen-2012-lxjs-lisbon
Richard rodger-appgen-2012-lxjs-lisbonRichard rodger-appgen-2012-lxjs-lisbon
Richard rodger-appgen-2012-lxjs-lisbon
 

Recently uploaded

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 

Recently uploaded (20)

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 

20120802 timisoara

  • 1. Node.js & Mobile Apps Richard Rodger @rjrodger nearform.com
  • 2. •Why should you use Node.js? •Node.js basics •Lessons from a real world project
  • 3. nodejs.org • Code in JavaScript on the server • Built using Chrome V8 Engine - so it's really fast! • Everything is event-based; there are no threads
  • 4. Node.js Web Server var http = require('http'); var server = http.createServer( function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}) res.end('Hello Worldn') }); server.listen(80, '127.0.0.1'); console.log('Web server running at http://127.0.0.1:80');
  • 6. there are three eras... 1990's 2000's 2010's
  • 7. "keep your job" Node.js is languages the platform * yes I know about tiobe.com
  • 8. how many concurrent clients? 90's: 10 00's: 100 10's: 1000 C10K Problem
  • 9. How do you scale? processes threads events
  • 10. JavaScript: the world's ugliest language avoid slow, validate forms date ECMA, jQuery marry Node.js, Crockford
  • 11. Where will your app live? co-lo buy, build, and rack IaaS Amazon EC2 PaaS Heroku
  • 12. Don't Forget the Web browser wars web 2.0 standardise!
  • 13.
  • 14. Mobile Hybrid Native Web HTML5/JS Gotta learn 'em all* HTML5/JS
  • 15. Mobile Web Apps • Web Pages built using HTML5 features: • Canvas for drawing • In-built Video and Audio • Geolocation • Web Sockets • Local Storage, Local Caching • CSS3 transitions (not really HTML5) • Use JavaScript as main programming language ft.com business • Designed for Touch Interfaces post.ie • Smart phone or Tablet form factors • Don’t use Hover effects, instead convey touch affordance using 3D styling • Dynamic single page apps. Changes are made to the HTML rather than loading new pages.
  • 16. Mobile Web Standards Compliance Latest Versions Storage CSS3 Mobile Multimedia local, cache, sql effects, 2D, 3D touch, geo & motion video & audio iOS ★★★ ★★★ ★★★ ★★ Android ★★★ ★★★ ★★★ ★ Win Ph. 7 ★ ★★ ★ ★ BlackBerry 6+ ★★ ★★ ★★ ★ Legacy recent Nokias ★ ★ ★ mobilehtml5.org
  • 17.
  • 18. Node.js and Mobile nginx Node.js • nginx • high performance web server • serves static resources: test files, images • proxies requests through to Node.js app server • Node.js • high performance server-side JavaScript • Executes business logic and database queries
  • 19. • Runs high-performance server-side JavaScript • open source, sponsored by joyent.com • Uses the Google Chrome V8 engine • just-in-time compilation to machine code • generation garbage collection (like the Java JVM) • creates virtual “classes” to optimise property lookups • Has a well-designed module system for third party code - very effective and simple to use • Your code runs in a single non-blocking JavaScript thread • That’s OK, most of the time you’re waiting for database or network events
  • 20. being event-driven is like having a butler run your server
  • 21. Your code runs in one thread only!
  • 22. Working with Events var http = require('http'); var server = http.createServer(); server.on( 'request', function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}) var echo = '' req.on('data',function(chunk){ echo += chunk }) req.on('end', function(){ res.end( echo+'n' ) }) req.on('error', function(err){ res.end( "error: "+err ) }) }) server.listen(80, '127.0.0.1'); console.log('try: curl http://127.0.0.1 -d hello');
  • 23. What does the core API give you? Q basics: file system, ... 9 control: events, streams, buffers... g networking: sockets, DNS, ... „ web server: HTTP handling, ...
  • 24. Node.js modules are so cool • Easy syntax • var moduleAPI = require("modulename"); • Central repository • npmjs.org • Easy command line install • npm install modulename • No version conflicts! • intelligent dependency management • Declarative project description • package.json file goes into project root folder
  • 25. Some important modules (find them on npmjs.org or github.com) • connect • HTTP middleware infrastructure - requests pass through layers • express • JSP/ASP style dynamic server-side pages • underscore • same as client-side library! provides functional utilities: map, reduce, ... • socket.io • HTML5 real-time web sockets that "just work" - includes client-side API • request • easy outbound calls to web services
  • 26. Node.js is It doesn't overhyped matter • Not a clear winner against • Chrome V8 Engine means Node.js is "Good Enough" other event servers on speed • Asynchronous code is harder • JavaScript means almost all libraries are asynchronous, unlike than synchronous code other event servers • No, you wont re-use much • JavaScript is a local maximum and code between client and you're stuck with it server • Same language on client and server makes your brain happy • Memory can still leak • Compile to JavaScript if you really • It's not a mature platform hate the language
  • 28. Web Mobile Cloud Services Web Apps Services API Mobile & REST & Database Tablet Web JSON Mobile & Horizontal Third Party Tablet Apps Scale Services Desktop Cloud Monitoring Web Hosted
  • 29. Client-side Router #! URLs • Common code-base • even for hybrid apps! Models Data, biz logic • backbone.js • shims for weak browsers Views DOM Layout • browser-targeting: user- agent & capabilities • responsive layout (mostly) Helpers Shared code
  • 30. Server-side map /api/ URLs • nginx & Node.js Router to functions • Small code volume API function( req, • Third party modules: functions res ) { ... } • connect Shared code • express Helpers (some with client) • seneca (my db layer) Open source • Deploy with: Modules heavy-lifting • sudo killall node
  • 31. Cloud Services Database Hosting Monitors MongoDB Amazon Amazon Load Redis cloudkick Balancer Instance memcached Continuous Scaling
  • 32. Third Party Integration JSON, XML, simple form data, text files, ... ... all easy using JavaScript and Node.js Modules Analytics Twitter E-Commerce In-App Logging Facebook Purchasing Email LinkedIn Stock Feed
  • 33. Native Apps Same code as mobile web versions, ... ... wrapped using PhoneGap to run natively ... plus some native plugins
  • 35. Lesson: code volume 4 3 2 1 0 Client JavaScript Server JavaScript
  • 36. Lesson: multi-platform client-side JavaScript is really hard • a framework is a must • code against ECMA, use shims to support older browsers • backbone.js • Code/Test/Debug inside Safari • business logic must be in • phonegap.github.com/weinre common code for hard to reach places • browser-specific code • use error capture in production • virtual .js files • Finally, use a simple static site as a fallback (also for Googlebot) • use jshint to keep IE happy
  • 37. Lesson: multi-platform HTML/CSS is really hard • "structured" CSS is a must • Clean, semantic HTML is not optional • sass or less • graceful degradation may • Be happy with require radically different CSS • media queries • 100% "Responsive" design is tough • CSS3 transforms • Responsive within browser subsets has higher reward/ • browser-specific code effort • virtual .css files
  • 38. Lesson: the app stores are not web sites • that bug in version 1... • you can't deploy hot fixes • will take two weeks to • make everything fix via an update configurable! • some users will never • All prices, text, host update names, urls, ... • appears after an OS • On launch, app "checks-in" update for new configuration • this will save your life
  • 39. Lesson: Node.js does what it says on the tin • High performance • callback spaghetti is not a problem in practice • High throughput • Low CPU usage • use functional style • Constant memory usage • client-side code is far more difficult • leaks will kill, but then • Don't do CPU intensive stuff • < 100ms startup time • ... there's a warning on • means you may not the tin! notice!
  • 40. Lesson: Outsource your database • Remote MongoDB • Big productivity gain hosting • no production tuning • mongohq.com • no configuration • No downtime • no cluster set up • Backups • Low latency (in Amazon) • Web-based admin (if lazy)
  • 41. Node.js means Rapid Development * Bruno Fernandez-Ruiz http://www.olympum.com/architecture/the- nodejs-innovation-advantage/
  • 42. My Company Mobile Apps + Node.js My Book richardrodger.com Richard Rodger @rjrodger nearform.com

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n