real time web
DESCRIPTION
The talk I did at 2012 Ruby Conf China. Introduction to real time web, solutions and how to choose different solution for different site.TRANSCRIPT
http://www.wired.com/images_blogs/gadgetlab/2011/05/google_io_f.jpg
Nice to meet you!
https://github.com/sishen
@yedingding
@yedingdinghttp://weibo.com/presently
https://pragmatic.ly
Let’s Begin!
http://www.sneijers.net/wp-content/uploads/2011/12/web-150x150.jpghttp://www.lyngsat-logo.com/tvchannel/it/Real-Time.html
UX-driven evolution of Web
http://edudemic.com/wp-content/uploads/2012/07/future-400x300.jpg
What’s “Real Time”?
Show Me!
Instant Messaging
Apple Push Notification
Internet Game
http://s2.img.766.com/194/120217/1613/144125.jpg
Persistent Connection
Real Time in Web?
Persistent Connection
betweenBrower and Server
http://careers.accenture.com/Microsites/uk-graduate/PublishingImages/programmes/consulting/teach_first.jpg
But
Based on HTTP Protocol
Request - Response Protocol
Stateless Protocol
HTTP Protocol
Request - Response Protocol
Stateless Protocol
http://www.pdidevelopment.net/Images/picture/difficulty.jpg
Solutions
XHR Polling Long Polling HTTP Streaming Flash Socket WebSocket ….
XHR Polling
Long Polling
HTTP Streaming
Flash Socket
WebSocket
XHR Polling
LongPolling
HTTP Streaming
Flash Socke
t
WebSocket……
http://www.specialistpainphysio.com/wp-content/uploads/2012/08/thinking-pic.jpg
How to Choose?
Real Time Centric
Real Time Supplemental
VS
Real Examples
Pragmatic.ly
Pragmatic.ly
WebSocket XHR Polling Long Polling HTTP Streaming Flash Socket
Integration Fasthttp://thatimthing.com/wp-content/uploads/2011/02/HandsMovingFastOnKeyboard.jpg
Work Fast
http://www.devilslab.com/wp-content/uploads/2010/08/fast_snail_id86636_size350.jpg
Light Weighthttp://darkjade68.files.wordpress.com/2012/01/white-feather.jpg
SlangerOpen Source Pusher Server
Good for Dev
em-websocketEventMachine based
WebSocket Server
HipChat
HipChat
Long Polling XHR Polling HTTP Streaming Flash Socket WebSocket
BOSHBidirectional-Streams Over
Synchronous HTTP
https://upload.wikimedia.org/wikipedia/de/thumb/e/ea/Logo_XMPP_Standards_Foundation.svg/500px-Logo_XMPP_Standards_Foundation.svg.png
Easy to Scale
Easy to Extend
Works Everywhere
http://i.cmpnet.com/bmighty/images/slideshows/20090121/slide1A.jpg
Jabber Clients
RubyBOSH
stropherubylibstrophe.js
Twitter Web
Real Time is sugar
http://images.sciencedaily.com/2008/12/081210090819-large.jpg
Twitter Web
XHR Polling Long Polling HTTP Streaming Flash Socket WebSocket
http://www.dealz.ie/images/4347/original/simple.jpg
AcceptableSmart interval
Save Resource
Twitter Streaming API
Twitter Streaming API
HTTP Streaming XHR Polling Long Polling Flash Socket WebSocket
Low Overhead
Low Latency
API Friendly
RainbowThin
Rack::Stream
Weibo Web
XHR Polling Long Polling HTTP Streaming Flash Socket WebSocket
Weibo IM
Long Polling XHR Polling HTTP Streaming Flash Socket WebSocket
Bayeux Protocol
Faye
Thank You!