Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Streaming Service on Flex and Rails

1,744 views

Published on

Slides for Streaming Service on Flex and Rails at Ruby Tuesday.

Published in: Education, Technology
  • Be the first to comment

Streaming Service on Flex and Rails

  1. 1. Streaming Service upon Flex and Rails RhemaTech
  2. 2. We work in Rhematech Inc. RhemaTech
  3. 3. We provide live Streaming service over Internet on web RhemaTech
  4. 4. 100+ concurrent channels RhemaTech
  5. 5. 50000+ concurrent audience per channel RhemaTech
  6. 6. Short demo (todo) RhemaTech
  7. 7. System Structure RhemaTech
  8. 8. Encoder/Audience UI Flex Event Management System Rails Channel Management System Media Server Java/C++ RhemaTech
  9. 9. Main Challenges : Cost and Scalability RhemaTech
  10. 10. We choose Flex and Rails because of RhemaTech
  11. 11. COST RhemaTech
  12. 12. We were used to be .NET users RhemaTech
  13. 13. We suffered from high development and deployment cost RhemaTech
  14. 14. It fails to respond dynamic requirements RhemaTech
  15. 15. We did take Silverlight into consideration RhemaTech
  16. 16. Not popular enough RhemaTech
  17. 17. Poor designer support RhemaTech
  18. 18. No alternatives for media server RhemaTech
  19. 19. Flex and Rails save us RhemaTech
  20. 20. Serve multimedia on web RhemaTech
  21. 21. Rich user interaction RhemaTech
  22. 22. Run over standard protocols RhemaTech
  23. 23. Low development and deployment cost RhemaTech
  24. 24. Good looking RhemaTech
  25. 25. Service on mobile device (in the future) RhemaTech
  26. 26. Lessons we learned RhemaTech
  27. 27. #1. Be RESTful RhemaTech
  28. 28. Consistent API design RhemaTech
  29. 29. Consistent error handling RhemaTech
  30. 30. Easier to extend and modify RhemaTech
  31. 31. Always return errors in JSON/XML with 200 Ok RhemaTech
  32. 32. flash.net.URLLoader does not handle HTTP error code well RhemaTech
  33. 33. remove protect_from_forgery from environment.rb RhemaTech
  34. 34. #2. Use JSON instead of XML RhemaTech
  35. 35. Less Traffic (quite important for large service) RhemaTech
  36. 36. Easier to parse complex response RhemaTech
  37. 37. Rails JSON Gotcha RhemaTech
  38. 38. Rails does not unescape unicode while decoding RhemaTech
  39. 39. Fixed in Rails 2.3 RhemaTech
  40. 40. #3. Flash uses different session for file uploading on non-IE browsers RhemaTech
  41. 41. Flash uses its http socket for file uploading on non-IE browsers RhemaTech
  42. 42. Work Around - Session Migration RhemaTech
  43. 43. #4. Handle Browser onbeforeunload event. RhemaTech
  44. 44. Flash does not close NetConnection until you close all browser windows! RhemaTech
  45. 45. #5. Create a controller to deliver debug .swf file in development mode. RhemaTech
  46. 46. route.rb map.connect '/encoder.swf', :controller => “debugquot;, :action => quot;encoderquot; if RAILS_ENV == ‘development' RhemaTech
  47. 47. debug_controller.rb def encoder send_file(path_to_debug_swf, options) end RhemaTech
  48. 48. Makes debug and trace with rails much easier RhemaTech
  49. 49. #6. Pick right video codec RhemaTech
  50. 50. H263 vs. VP6 vs. H264 RhemaTech
  51. 51. H.263 Pros: Flash Player build-in Cons: Poor quality RhemaTech
  52. 52. VP6 Pros: Good video quality Cons: Expensive RhemaTech
  53. 53. H264 Pros: Good Quality Cons: 2~6s more latency RhemaTech
  54. 54. Questions? RhemaTech

×