SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
Makoto




           RTW – WTF?
         Real Time Web – What’s That For?
         Makoto Inoue - Martyn Loughran
Who are we?
RTW
Exciting
The big guys already do it


  Google wave
  Facebook live feed
  Twitter
This is our story
Martyn

         Once upon a time...




                               November 2009
Visualise web traffic
    Rack           Sinatra Stats
 Existing app       Collector




                Fancy Visualization
Under the hood
Nginx HTTP_Push_Module
Long polling
Push handled by separate component
Worked, but fiddly to setup
Makoto
         WebSockets




         http://www.flickr.com/photos/lenaah/2939721384/




                                                          December 2009
WebSockets
HTML5 sub standard
Allows Socket in the browser
Now supported in the ‘non-shite’
browsers
 Chrome & Webkit (nightly)
 There is a library for flash emulation
Ajax vs Comet vs WebSocket
                                         Server
Ajax
(Polling)
                                         Client
                                         Server
Comet
(Long polling)
                                         Client

                                         Server


WebSocket
                                         Client
Javascript API
Martyn
         Server Side




         http://www.flickr.com/photos/lenaah/2939721384/




                                                          December 2009
Fun problems

Concurrent
Stateful
Low latency (sometimes)
Asynchronous servers

  Make all IO non-blocking
  Single thread
  Efficient CPU utilisation
Simple example
Other options
em-websocket
cramp
sunshowers
node.js (js)
Example: Drawing




  http://github.com/markevans/websocket_test
class Connection
          class << self
            def add(websocket)
              connections << websocket
            end

            def all
              connections
            end

            def remove(websocket)
              connections.delete(websocket)
            end

            private

            def connections
              @connections ||= []
            end
          end
        end


Keep connection objects in memory
EventMachine.run {
  EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 3001) do |ws|
      ws.onopen {
        puts "WebSocket connection open"
        Connection.add(ws)
      }

          ws.onclose { Connection.remove(ws) }

          ws.onmessage { |data|
            Connection.all.each do |ws|
              ws.send(data) unless ws == self
            end
          }
    end
}
Demo
We wanted to add it
  to everything




    http://www.flickr.com/photos/10737604@N02/1673136876/

                                                   January 2010
Mandays
Work Schedule Management
TrueStory
Backlog Management
Problems
Data gets stale
People make conflicting changes
This discourages collaboration
Requirements

We didn’t want to re-write everything
Reusable by many apps
Really simple
Our solution
+
Look Ma




http://www.flickr.com/photos/jeremystockwell/2691931146/   February 2010
Case Study

Adding real time to TrueStory
Data Flow
Inspired by JS events
 Trigger in on place
 Bind in another
$('form#sprint').submit(function(){
  var url = $(this).attr('action');
  var data = $(this).serialize();

  $.ajax({                    def create
    url: url,                   @sprint = Sprint.new(params)
    data: data                  @sprint.save
  });
});                             Pusher['project-1'].trigger
                              ('sprints-create', @sprint.attributes)
                              end

pusher.bind('sprints-create', function(attributes) {
   addSprint(attributes);
})
Stateful client
http://github.com/benpickles/js-model
In memory object client side
Asynchronous persistence (e.g. to a
REST API)
Used on TrueStory - let me show you
var sprint = new Sprint(
   {                          def create
     name: "My Sprint Name"     @sprint = Sprint.new(params)
   }                            @sprint.save
);
sprint.save();                  Pusher['project-1'].trigger
                              ('sprints-create', @sprint.attributes)
                                respond_to do |format|
                                  format.js {
                                    render :json => @sprint.to_json
                                  }
                                end
                              end


pusher.bind('sprints-create', function(attributes) {
   var sprint = new Sprint(attributes);
   Sprint.add(sprint);
})
Makoto
         Look Ma




                   March 2010
Task Management Board
Debugging
Booking
Wife Notifier
Summary




http://www.flickr.com/photos/blueju38/2767019065/
RTW
            (our take)
More than just chat
Another layer of progressive enhancement
Work well with other HTML5 features
Resources
    WebSockets
•   http://dev.w3.org/html5/websockets

•   http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75

•   http://blog.new-bamboo.co.uk/2009/12/30/brain-dump-of-real-time-web-rtw-and-websocket


    Javascript (Client side)
•   http://blog.new-bamboo.co.uk/2010/2/10/json-event-based-convention-websockets

•   http://blog.new-bamboo.co.uk/2010/3/7/the-js-model-layer


    Ruby (Server side)
•   http://github.com/igrigorik/em-websocket

•   http://github.com/lifo/cramp

•   http://rainbows.rubyforge.org/sunshowers
One more thing...
Questions ?



http://pusherapp.com
    Get hooked!

Weitere ähnliche Inhalte

Was ist angesagt?

Ускоряем загрузку картинок вебсокетами
Ускоряем загрузку картинок вебсокетамиУскоряем загрузку картинок вебсокетами
Ускоряем загрузку картинок вебсокетами
2ГИС Технологии
 
Backbone.js slides
Backbone.js slidesBackbone.js slides
Backbone.js slides
Ambert Ho
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
Pragnesh Vaghela
 
Realtime web apps rails
Realtime web apps railsRealtime web apps rails
Realtime web apps rails
Ambert Ho
 
Openstack glance
Openstack glanceOpenstack glance
Openstack glance
SHAMEEM F
 

Was ist angesagt? (20)

Introduction to VueJS & Vuex
Introduction to VueJS & VuexIntroduction to VueJS & Vuex
Introduction to VueJS & Vuex
 
OpenStack Glance
OpenStack GlanceOpenStack Glance
OpenStack Glance
 
Meteor presentation
Meteor presentationMeteor presentation
Meteor presentation
 
Ускоряем загрузку картинок вебсокетами
Ускоряем загрузку картинок вебсокетамиУскоряем загрузку картинок вебсокетами
Ускоряем загрузку картинок вебсокетами
 
Vue.js
Vue.jsVue.js
Vue.js
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
 
Backbone.js slides
Backbone.js slidesBackbone.js slides
Backbone.js slides
 
[20180226] I understand webpacker perfectly
[20180226] I understand webpacker perfectly[20180226] I understand webpacker perfectly
[20180226] I understand webpacker perfectly
 
Introduction to Backbone.js
Introduction to Backbone.jsIntroduction to Backbone.js
Introduction to Backbone.js
 
Kickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with YeomanKickstarting Node.js Projects with Yeoman
Kickstarting Node.js Projects with Yeoman
 
Universal JS Applications with React
Universal JS Applications with ReactUniversal JS Applications with React
Universal JS Applications with React
 
Vue business first
Vue business firstVue business first
Vue business first
 
Realtime web apps rails
Realtime web apps railsRealtime web apps rails
Realtime web apps rails
 
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
The Mobile Development Landscape
The Mobile Development LandscapeThe Mobile Development Landscape
The Mobile Development Landscape
 
Vue, vue router, vuex
Vue, vue router, vuexVue, vue router, vuex
Vue, vue router, vuex
 
Openstack glance
Openstack glanceOpenstack glance
Openstack glance
 
The Complementarity of React and Web Components
The Complementarity of React and Web ComponentsThe Complementarity of React and Web Components
The Complementarity of React and Web Components
 
Whirlwind tour of activiti 7
Whirlwind tour of activiti 7Whirlwind tour of activiti 7
Whirlwind tour of activiti 7
 

Andere mochten auch

Remax Listing Presentation
Remax Listing PresentationRemax Listing Presentation
Remax Listing Presentation
markfortson
 
Ball State Martial Arts Club Eng213 Promo
Ball State Martial Arts Club Eng213 PromoBall State Martial Arts Club Eng213 Promo
Ball State Martial Arts Club Eng213 Promo
kaedenboroug
 
User Experience Design at Bernard Hodes Group
User Experience Design at Bernard Hodes GroupUser Experience Design at Bernard Hodes Group
User Experience Design at Bernard Hodes Group
Ryan Nance
 

Andere mochten auch (12)

Best Of National Geographic 18407
Best Of National Geographic 18407Best Of National Geographic 18407
Best Of National Geographic 18407
 
Remax Listing Presentation
Remax Listing PresentationRemax Listing Presentation
Remax Listing Presentation
 
Ball State Martial Arts Club Eng213 Promo
Ball State Martial Arts Club Eng213 PromoBall State Martial Arts Club Eng213 Promo
Ball State Martial Arts Club Eng213 Promo
 
A 2D Spatial Light Modulator for spatio-temporal shaping
A 2D Spatial Light Modulator for spatio-temporal shapingA 2D Spatial Light Modulator for spatio-temporal shaping
A 2D Spatial Light Modulator for spatio-temporal shaping
 
Shift Happens 23665
Shift Happens 23665Shift Happens 23665
Shift Happens 23665
 
Falke School
Falke SchoolFalke School
Falke School
 
Reagan 1
Reagan 1Reagan 1
Reagan 1
 
getting the experience right
getting the experience rightgetting the experience right
getting the experience right
 
Bestemming zeezeilen 2008
Bestemming zeezeilen 2008Bestemming zeezeilen 2008
Bestemming zeezeilen 2008
 
15 Amazing Illusions Pictures 1203685223642925 3
15 Amazing Illusions Pictures 1203685223642925 315 Amazing Illusions Pictures 1203685223642925 3
15 Amazing Illusions Pictures 1203685223642925 3
 
User Experience Design at Bernard Hodes Group
User Experience Design at Bernard Hodes GroupUser Experience Design at Bernard Hodes Group
User Experience Design at Bernard Hodes Group
 
Subjects repositories supporting open access
Subjects repositories supporting open accessSubjects repositories supporting open access
Subjects repositories supporting open access
 

Ähnlich wie Real Time Web - What's that for?

Speak the Web 15.02.2010
Speak the Web 15.02.2010Speak the Web 15.02.2010
Speak the Web 15.02.2010
Patrick Lauke
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
Ariya Hidayat
 

Ähnlich wie Real Time Web - What's that for? (20)

Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
Introduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and SilverlightIntroduction to JQuery, ASP.NET MVC and Silverlight
Introduction to JQuery, ASP.NET MVC and Silverlight
 
Meteor
MeteorMeteor
Meteor
 
Comet with node.js and V8
Comet with node.js and V8Comet with node.js and V8
Comet with node.js and V8
 
Cloud State of the Union for Java Developers
Cloud State of the Union for Java DevelopersCloud State of the Union for Java Developers
Cloud State of the Union for Java Developers
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
The HTML5 WebSocket API
The HTML5 WebSocket APIThe HTML5 WebSocket API
The HTML5 WebSocket API
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
Meetup Performance
Meetup PerformanceMeetup Performance
Meetup Performance
 
NTT SIC marketplace slide deck at Tokyo Summit
NTT SIC marketplace slide deck at Tokyo SummitNTT SIC marketplace slide deck at Tokyo Summit
NTT SIC marketplace slide deck at Tokyo Summit
 
Hopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherHopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to another
 
Speak the Web 15.02.2010
Speak the Web 15.02.2010Speak the Web 15.02.2010
Speak the Web 15.02.2010
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 
Making Modern Websites
Making Modern WebsitesMaking Modern Websites
Making Modern Websites
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
 
Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020
Choose Your Own Adventure with JHipster & Kubernetes - Denver JUG 2020
 
Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)
Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)
Automatic deployment on .NET web stack (Minsk .NET meetup 12.02.14)
 
Serverless 프레임워크로 Nuxt 앱 배포하기
Serverless 프레임워크로 Nuxt 앱 배포하기Serverless 프레임워크로 Nuxt 앱 배포하기
Serverless 프레임워크로 Nuxt 앱 배포하기
 

Kürzlich hochgeladen

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Real Time Web - What's that for?