Using Node.js to improve the performance of Mobile apps and Mobile web

19,283 views
19,201 views

Published on

Published in: Technology, Business
0 Comments
15 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
19,283
On SlideShare
0
From Embeds
0
Number of Embeds
11,673
Actions
Shares
0
Downloads
111
Comments
0
Likes
15
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Using Node.js to improve the performance of Mobile apps and Mobile web

    1. 1. Using Node.js to improve the performance of Mobile apps and Mobile web Tom Hughes-Croucher Jetpacks for Dinosaurs, LLCtom@jetpacksfordinosaurs.com@sh1mmer
    2. 2. Scalable Server-Side Code with JavaScript Who is Tom? • Wrote W3C Standards • • 10+ years in the web industry Worked on projects for: Tesco, NASA, Walmart, MySpace, etc Node Up and Running • ~5 years at Yahoo! including .com Tom Hughes-Croucher • Node team at Joyent@sh1mmer
    3. 3. • You probably shouldnt let Twitter name your company • Clients include • Walmart • MySpace • Various Fortune 500 companies • Multiple stealth startups@sh1mmer
    4. 4. This is a talk about why cell phones suck.@sh1mmer
    5. 5. @sh1mmer
    6. 6. Radio waves suck (at least compared to fibre or copper)@sh1mmer
    7. 7. http://developer.yahoo.com/blogs/ydn/posts/2009/10/a_engineers_gui/@sh1mmer
    8. 8. Radio vs. buildings@sh1mmer
    9. 9. @sh1mmer
    10. 10. @sh1mmer
    11. 11. @sh1mmer
    12. 12. Desktop Mobile http://www.webperformancetoday.com/2012/04/02/mobile-versus-desktop-latency/@sh1mmer
    13. 13. Ookla/speedtest.net via http://www.slideshare.net/patrickmeenan/velocity-2012-taming-the-mobile-beast/22@sh1mmer
    14. 14. Effect of latency on servers@sh1mmer
    15. 15. Shielding Frontends@sh1mmer
    16. 16. nginx haproxy web services frontends ATS / data varnish@sh1mmer
    17. 17. var client = net.connect(80, domain, function() { client.write("GET / HTTP/1.1rn"); t1 = (new Date()).getTime(); }); client.on(end, function() { t2 = (new Date()).getTime(); output.write(domain + + ((t2-t1)/1000) + sn); });@sh1mmer
    18. 18. Sample of Alexa 5000 macupdate.com 442.3 uzai.com 403.658 wired.jp 238.848 facilisimo.com 205.159 mycokerewards.com 202.757 rbc.cn 192.354 moviesmobile.net 183.157 stop55.com 145.927 dir.bg 137.982 carrefour.fr 112.789 sifyitest.com 111.171@sh1mmer
    19. 19. Event-driven Frontends@sh1mmer
    20. 20. Client → Server Server → DB Computation Computation@sh1mmer
    21. 21. Not an event frontend@sh1mmer
    22. 22. @sh1mmer
    23. 23. Server@sh1mmer
    24. 24. Request@sh1mmer
    25. 25. @sh1mmer
    26. 26. Event-driven frontend@sh1mmer
    27. 27. Place-holder@sh1mmer
    28. 28. @sh1mmer
    29. 29. Shared Work Resources@sh1mmer
    30. 30. Memory operations@sh1mmer
    31. 31. var x = "I am a string" ~1ns Running 1 instruction 2ns Data from l1 cpu cache 5ns Data from l2 cpu cache 80ns Data from ram@sh1mmer
    32. 32. @sh1mmer
    33. 33. Mobile latency@sh1mmer
    34. 34. @sh1mmer
    35. 35. 100 Blue Whales Cat@sh1mmer
    36. 36. "They went from running 15 servers with 15 instances (virtual servers) on each physical machine, to just four instances that can handle double the traffic." http://venturebeat.com/2011/08/16/linkedin-node/@sh1mmer
    37. 37. Not just simple applications@sh1mmer
    38. 38. @sh1mmer
    39. 39. @sh1mmer
    40. 40. First page load vs. Client MVC@sh1mmer
    41. 41. @sh1mmer
    42. 42. http://www.belshe.com/2010/05/24/more-bandwidth-doesnt-matter-much/@sh1mmer
    43. 43. Bandwidth Latency Device capability@sh1mmer
    44. 44. Barfing data at 3G@sh1mmer
    45. 45.                                                                                                                                                                                   @sh1mmer
    46. 46. @sh1mmer
    47. 47. Clientside templating@sh1mmer
    48. 48. @sh1mmer
    49. 49. Node.js allows you to tune rendering between client and server based on the network.@sh1mmer
    50. 50. HTML JSON More bandwidth Less bandwidth Less client processing More client processing Battery friendly Cheaper for you bandwidth/server Cheaper for them bandwidth@sh1mmer
    51. 51. Summary • Node.js allows you to: • Manage resources with unreliable mobile data connections • Choose where to apply rendering • Pick the right rendering solution for the right scenario@sh1mmer
    52. 52. Questionstom@jetpacksfordinosaurs.com @sh1mmer

    ×