SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Socket.io
           Realtime just got real.




Dienstag, 24. April 12
Me


                 Dominique Sandoz
                 Student @UZH

                 Worker @vonwaldkirch

                 @streunerlein




Dienstag, 24. April 12
You?




Dienstag, 24. April 12
The Story
           The tl;dr-section of this presentation




Dienstag, 24. April 12
Dienstag, 24. April 12
So why?




Dienstag, 24. April 12
Socket.io


                 easy
                 fast
                 solves a problem




Dienstag, 24. April 12
Socket.io



                 is for realtime exchange of data between Server and
                 Client (Browser)




Dienstag, 24. April 12
Realtime?




Dienstag, 24. April 12
setInterval(check, 10)?




Dienstag, 24. April 12
requestAnimationFrame()?




Dienstag, 24. April 12
No.




Dienstag, 24. April 12
Real realtime.




Dienstag, 24. April 12
Websockets!




Dienstag, 24. April 12
Dienstag, 24. April 12
Socket.io
           A deeper look.


                 Websocket wrapper
                 Node.js Module




Dienstag, 24. April 12
Socket.io
           A deeper look.


                 Socket between Server & Client
                 Send data from one to other
                 Receive data via events
                 asynchronous




Dienstag, 24. April 12
Socket.io
           Easyness is easy.


                         emit(event, data)



                         on(event, handler)




Dienstag, 24. April 12
Socket.io
           Easyness is easy.




                         Even Setup is easy!




Dienstag, 24. April 12
Socket.io
           Server Setup

               npm install socket.io




Dienstag, 24. April 12
Socket.io
           Client Setup




Dienstag, 24. April 12
Socket.io
           The Killers.


                 Compatibility
                 Scalability
                 Performance
                 Robustness




Dienstag, 24. April 12
Socket.io
           Compatibility




Dienstag, 24. April 12
Socket.io
           Compatibility




Dienstag, 24. April 12
Socket.io
           Compatibility



                 Websocket
                         Chrome 16, Firefox 11, IE 10, Safari 5. Opera 10
                         Built-in, disabled: Chrome 6, Firefox 4




Dienstag, 24. April 12
Dienstag, 24. April 12
Socket.io
           Compatibility - Holy Fallbacks!

                         WebSocket
                         Flash Socket
                         AJAX long polling
                         AJAX multipart streaming
                         Forever IFrame
                         JSONP Polling



Dienstag, 24. April 12
Socket.io
           Compatibility - Holy Fallbacks!

                 Socket.io falls
                 back to support
                 IE 5.5+
                 Safari 3+
                 Chrome 4+
                 Firefox 3+ Opera
                 10+



Dienstag, 24. April 12
Socket.io
           Scalability, Performance, Robustness




                                 :)


Dienstag, 24. April 12
Use cases
                 Chats
                 Realtime Applications
                 Collaboration Software
                 Social Networks
                 Single-page Apps!
                 Every Project (?)



Dienstag, 24. April 12
Hands-on!
           Demos.




Dienstag, 24. April 12
Q&A




Dienstag, 24. April 12
#kthxbye

                 Socket.io official: http://socket.io/

                 Websocket overview: http://davidwalsh.name/websocket




Dienstag, 24. April 12

Más contenido relacionado

Destacado

Building your First MEAN App
Building your First MEAN AppBuilding your First MEAN App
Building your First MEAN App
MongoDB
 
Building notification system in NodeJS + Redis
Building notification system in NodeJS + RedisBuilding notification system in NodeJS + Redis
Building notification system in NodeJS + Redis
Le Duc
 
Real-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and RedisReal-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and Redis
York Tsai
 

Destacado (14)

Data visualization
Data visualizationData visualization
Data visualization
 
Transforming WebSockets
Transforming WebSocketsTransforming WebSockets
Transforming WebSockets
 
Building your First MEAN App
Building your First MEAN AppBuilding your First MEAN App
Building your First MEAN App
 
Socket.io (part 1)
Socket.io (part 1)Socket.io (part 1)
Socket.io (part 1)
 
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
NodeJS & Socket IO on Microsoft Azure Cloud Web Sites - DWX 2014
 
Socket.IO - Alternative Ways for Real-time Application
Socket.IO - Alternative Ways for Real-time ApplicationSocket.IO - Alternative Ways for Real-time Application
Socket.IO - Alternative Ways for Real-time Application
 
Socket Programming
Socket ProgrammingSocket Programming
Socket Programming
 
Fun with D3.js: Data Visualization Eye Candy with Streaming JSON
Fun with D3.js: Data Visualization Eye Candy with Streaming JSONFun with D3.js: Data Visualization Eye Candy with Streaming JSON
Fun with D3.js: Data Visualization Eye Candy with Streaming JSON
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Building notification system in NodeJS + Redis
Building notification system in NodeJS + RedisBuilding notification system in NodeJS + Redis
Building notification system in NodeJS + Redis
 
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.ioReal Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.io
 
Going realtime with Socket.IO
Going realtime with Socket.IOGoing realtime with Socket.IO
Going realtime with Socket.IO
 
Real-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and RedisReal-time Web Application with Socket.IO, Node.js, and Redis
Real-time Web Application with Socket.IO, Node.js, and Redis
 
Mongo DBを半年運用してみた
Mongo DBを半年運用してみたMongo DBを半年運用してみた
Mongo DBを半年運用してみた
 

Similar a Socket io - JSZurich

Scaling Quizlet
Scaling QuizletScaling Quizlet
Scaling Quizlet
Quizlet
 
Symfony - Introduction
Symfony - IntroductionSymfony - Introduction
Symfony - Introduction
Piers Warmers
 
Cloud Foundry OpenTour Kiev Keynote
Cloud Foundry OpenTour Kiev KeynoteCloud Foundry OpenTour Kiev Keynote
Cloud Foundry OpenTour Kiev Keynote
Patrick Chanezon
 
refORM: Death to ORMs in .NET
refORM: Death to ORMs in .NETrefORM: Death to ORMs in .NET
refORM: Death to ORMs in .NET
James Hughes
 

Similar a Socket io - JSZurich (11)

Scaling Quizlet
Scaling QuizletScaling Quizlet
Scaling Quizlet
 
Berlin.JS Meetup
Berlin.JS MeetupBerlin.JS Meetup
Berlin.JS Meetup
 
Symfony - Introduction
Symfony - IntroductionSymfony - Introduction
Symfony - Introduction
 
Apple Bonjour: Let's Talk!
Apple Bonjour: Let's Talk!Apple Bonjour: Let's Talk!
Apple Bonjour: Let's Talk!
 
Vertx
VertxVertx
Vertx
 
RealTime Web with PocketIO
RealTime Web with PocketIORealTime Web with PocketIO
RealTime Web with PocketIO
 
Scaling the Cloud - Cloud Security
Scaling the Cloud - Cloud SecurityScaling the Cloud - Cloud Security
Scaling the Cloud - Cloud Security
 
Cloud Foundry OpenTour Kiev Keynote
Cloud Foundry OpenTour Kiev KeynoteCloud Foundry OpenTour Kiev Keynote
Cloud Foundry OpenTour Kiev Keynote
 
refORM: Death to ORMs in .NET
refORM: Death to ORMs in .NETrefORM: Death to ORMs in .NET
refORM: Death to ORMs in .NET
 
Introduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal devIntroduction to Node.js: perspectives from a Drupal dev
Introduction to Node.js: perspectives from a Drupal dev
 
Web application security
Web application securityWeb application security
Web application security
 

Último

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
 
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
 

Último (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Socket io - JSZurich