Building for the real-
time web with Node.js
         Timothy Strimple
       tstrimple@gmail.com
            @tstrimple
What is the real-time web?
Real-time web.
The real-time web is a set of technologies and practices that
enable users to receive information as soon as it is published by its
authors, rather than requiring that they or their software check a
source periodically for updates.
Examples of real-time websites
• Twitter
• Facebook
• Google real-time analytics
• Monitter.com
• http://kaazing.me/
• http://demo.kaazing.com/forex/
What is node.js?
 • Node + Javascript
 • Node is the cross platformframework
   provides the non-blocking
                              layer which
   which is the core of node.js.
  • Filesystem access
  • Networking
  • DNS
  • Etc...
What is node?
• Node is designed to be massively scalable.
• Jason Hoffman (CTO & Founder Joyent):
  Goal is one CPU (core) and < 1 GB ram
  hosting10GB/s, 1 million end points
Similar platforms
 • Similar to other event driven frameworks.
  • Python: Twisted
  • C: LibEvent
  • Ruby: EventMachine
 • Unlike these other frameworks, Node.js is
   not burdened by existing blocking libraries.
Non-blocking.
In node, non blocking means that any activity taking a long time to
finish, such as file access, network communication, and network
operations, are requested and put aside until the results are ready
to be returned ia a callback function.
Why Javscript?
 • It’s FAST! (V8)
 • Lots of commercial support.
  • Microsoft vs. Google vs. Mozilla
Why Javscript?
• It flattens your stack
 • You have to use javascript anyway
• First class functions!
 • Makes event driven programming very
     easy.
Socket.IO
Making real-time communication easy.
• Supported Communication Transports
 • WebSocket
 • Adobe Flash Socket
 • Ajax Long Polling
 • Ajax multi-part streaming
 • Forever iframe
 • JSONP Polling
Socket.IO
Supported Browsers

• Desktop                   • Mobile
 • Internet Explorer 5.5+    • iPhone Safari
 • Safari 3+                 • iPad Safari
 • Google Chrome 4+          • Android WebKit
 • Firefox 3+                • WebOs WebKit
 • Opera 10.61+
Lets see some code!
When to use node?
• Web APIs
 • Json EVERYWHERE!
• Streaming data
 • Real time encoding of data as it is being
    uploaded
• Soft real-time applications
 • Versus Hard or Firm real-time
When not to use node?
 • Simple CRUD web applications
 • CPU heavy applications
Contact Information
    tstrimple@gmail.com
         @tstrimple

Node

  • 1.
    Building for thereal- time web with Node.js Timothy Strimple tstrimple@gmail.com @tstrimple
  • 2.
    What is thereal-time web?
  • 3.
    Real-time web. The real-timeweb is a set of technologies and practices that enable users to receive information as soon as it is published by its authors, rather than requiring that they or their software check a source periodically for updates.
  • 4.
    Examples of real-timewebsites • Twitter • Facebook • Google real-time analytics • Monitter.com • http://kaazing.me/ • http://demo.kaazing.com/forex/
  • 5.
    What is node.js? • Node + Javascript • Node is the cross platformframework provides the non-blocking layer which which is the core of node.js. • Filesystem access • Networking • DNS • Etc...
  • 6.
    What is node? •Node is designed to be massively scalable. • Jason Hoffman (CTO & Founder Joyent): Goal is one CPU (core) and < 1 GB ram hosting10GB/s, 1 million end points
  • 7.
    Similar platforms •Similar to other event driven frameworks. • Python: Twisted • C: LibEvent • Ruby: EventMachine • Unlike these other frameworks, Node.js is not burdened by existing blocking libraries.
  • 8.
    Non-blocking. In node, nonblocking means that any activity taking a long time to finish, such as file access, network communication, and network operations, are requested and put aside until the results are ready to be returned ia a callback function.
  • 9.
    Why Javscript? •It’s FAST! (V8) • Lots of commercial support. • Microsoft vs. Google vs. Mozilla
  • 11.
    Why Javscript? • Itflattens your stack • You have to use javascript anyway • First class functions! • Makes event driven programming very easy.
  • 12.
    Socket.IO Making real-time communicationeasy. • Supported Communication Transports • WebSocket • Adobe Flash Socket • Ajax Long Polling • Ajax multi-part streaming • Forever iframe • JSONP Polling
  • 13.
    Socket.IO Supported Browsers • Desktop • Mobile • Internet Explorer 5.5+ • iPhone Safari • Safari 3+ • iPad Safari • Google Chrome 4+ • Android WebKit • Firefox 3+ • WebOs WebKit • Opera 10.61+
  • 14.
  • 20.
    When to usenode? • Web APIs • Json EVERYWHERE! • Streaming data • Real time encoding of data as it is being uploaded • Soft real-time applications • Versus Hard or Firm real-time
  • 21.
    When not touse node? • Simple CRUD web applications • CPU heavy applications
  • 22.
    Contact Information tstrimple@gmail.com @tstrimple