$30 off During Our Annual Pro Sale. View Details »

Real Time Web

Dingding Ye
November 18, 2012

Real Time Web

The talk I did at 2012 Ruby Conf China. Introduction to real time web, solutions and how to choose different solution for different site.

Dingding Ye

November 18, 2012
Tweet

More Decks by Dingding Ye

Other Decks in Technology

Transcript

  1. None
  2. http://www.wired.com/images_blogs/gadgetlab/2011/05/google_io_f.jpg

  3. None
  4. Nice to meet you! ွ᠘᠘ yedingding@gmail.com https://github.com/sishen @yedingding @yedingding http://weibo.com/presently

  5. https://pragmatic.ly

  6. Let’s Begin!

  7. http://www.sneijers.net/wp-content/uploads/2011/12/web-150x150.jpg http://www.lyngsat-logo.com/tvchannel/it/Real-Time.html

  8. UX-driven evolution of Web

  9. http://edudemic.com/wp-content/uploads/2012/07/future-400x300.jpg

  10. What’s “Real Time”?

  11. Show Me!

  12. Instant Messaging

  13. Apple Push Notification

  14. Internet Game http://s2.img.766.com/194/120217/1613/144125.jpg

  15. Persistent Connection

  16. Real Time in Web?

  17. Persistent Connection between Brower and Server http://careers.accenture.com/Microsites/uk-graduate/PublishingImages/programmes/consulting/teach_first.jpg

  18. But

  19. Based on HTTP Protocol ž  Request - Response Protocol ž 

    Stateless Protocol
  20. HTTP Protocol ž  Request - Response Protocol ž  Stateless Protocol

  21. http://www.pdidevelopment.net/Images/picture/difficulty.jpg

  22. Solutions ž  XHR Polling ž  Long Polling ž  HTTP Streaming

    ž  Flash Socket ž  WebSocket ž  ….
  23. XHR Polling

  24. Long Polling

  25. HTTP Streaming

  26. Flash Socket

  27. WebSocket

  28. XHR Polling Long Polling HTTP Streaming Flash Socket WebSocket ……

    http://www.specialistpainphysio.com/wp-content/uploads/2012/08/thinking-pic.jpg
  29. How to Choose?

  30. Real Time Centric Real Time Supplemental VS

  31. Real Examples

  32. Pragmatic.ly

  33. Pragmatic.ly ž WebSocket ž  XHR Polling ž  Long Polling ž  HTTP

    Streaming ž  Flash Socket
  34. Integration Fast http://thatimthing.com/wp-content/uploads/2011/02/HandsMovingFastOnKeyboard.jpg

  35. Work Fast http://www.devilslab.com/wp-content/uploads/2010/08/fast_snail_id86636_size350.jpg

  36. Light Weight http://darkjade68.files.wordpress.com/2012/01/white-feather.jpg

  37. None
  38. Slanger Open Source Pusher Server Good for Dev

  39. em-websocket EventMachine based WebSocket Server

  40. HipChat

  41. None
  42. HipChat ž Long Polling ž  XHR Polling ž  HTTP Streaming ž 

    Flash Socket ž  WebSocket
  43. BOSH Bidirectional-Streams Over Synchronous HTTP

  44. https://upload.wikimedia.org/wikipedia/de/thumb/e/ea/Logo_XMPP_Standards_Foundation.svg/500px-Logo_XMPP_Standards_Foundation.svg.png

  45. Easy to Scale

  46. Easy to Extend

  47. Works Everywhere http://i.cmpnet.com/bmighty/images/slideshows/20090121/slide1A.jpg

  48. Jabber Clients

  49. RubyBOSH

  50. stropheruby libstrophe.js

  51. None
  52. Twitter Web

  53. Real Time is sugar http://images.sciencedaily.com/2008/12/081210090819-large.jpg

  54. Twitter Web ž  XHR Polling ž Long Polling ž  HTTP Streaming

    ž  Flash Socket ž  WebSocket
  55. http://www.dealz.ie/images/4347/original/simple.jpg

  56. Acceptable Smart interval

  57. Save Resource

  58. Twitter Streaming API

  59. Twitter Streaming API ž  HTTP Streaming ž  XHR Polling ž Long

    Polling ž  Flash Socket ž  WebSocket
  60. None
  61. Low Overhead

  62. Low Latency

  63. API Friendly

  64. Rainbow Thin

  65. Rack::Stream

  66. Weibo

  67. Weibo Web ž  XHR Polling ž Long Polling ž  HTTP Streaming

    ž  Flash Socket ž  WebSocket
  68. Weibo IM ž Long Polling ž  XHR Polling ž  HTTP Streaming

    ž  Flash Socket ž  WebSocket
  69. Bayeux Protocol

  70. Faye

  71. Thank You!