Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Planetary Scale Web Architecture: A Gentle Introduction

Planetary Scale Web Architecture: A Gentle Introduction

A high level introduction to massively scalable web servers, intended for an audience with only basic technical background (first year undergraduate level).

A5f3383a1a0c7e6d3df7f06361e39a5c?s=128

John Arthorne

June 20, 2016
Tweet

Transcript

  1. A Gentle Introduction Planetary Scale Web Architecture John Arthorne @jarthorne

    http://jarthorn.github.io/ Image: Creative Commons https://www.youtube.com/watch?v=3fWbfSdYMJw
  2. 2 Overview • What does a trivial web application look

    like? • What does a typical real world web application look like? • What does a web application serving a billion requests a day from across the planet with low latency and no downtime look like?
  3. 3 A Trivial Web Application

  4. Data Center 4 A Trivial Web App The Internet Host

    Machine Web Server GET http://example.com/index.html 200 OK
  5. 5 A Typical Web Application

  6. Data Center 6 A Typical Web App The Internet Host

    Machine We often need to store things like text, numbers, images, etc… Web Server Database … so we add databases
  7. Data Center 7 A Typical Web App The Internet Host

    Machine Web Server A gatekeeper is useful to keep bad requests out and make sure good requests go to the right place… Database Load Balancer / Proxy … so we add a proxy at the front
  8. Optimizing Checkout Lines

  9. Data Center 9 A Typical Web App The Internet Host

    Machine Web Server Some tasks take a long time or have unpredictable duration… Database Load Balancer / Proxy … so we add a job server Job Server
  10. 1 0 Ok, so we’re done, right?

  11. 1 1 What could possibly go wrong?

  12. 1 2 The Internet is a chaotic place Billions of

    connected devices Global in scope Highly unpredictable Malicious attackers Out of control robots (bots)
  13. 1 3 Computers break. A lot.

  14. 1 4 • Complex stack of software • Running on

    hardware that can break any time • Operating in the chaotic world of the Internet • Failures cost $$$ and damage customer trust Summary so far
  15. 1 5 A Scalable, Resilient Web Application

  16. 1 6 • If it can break, it will break

    • If it is important, have more than one • Slow is better than degraded, degraded is better than down • Practice and prepare for failures Resiliency Principles
  17. 1 7 The Villain Watch out for S.P.O.F.! (Single Point

    of Failure) Images courtesy of clipartpanda.com Production Engineers to the Rescue! The Heroes
  18. Single Point of Failure Example Fort McMurray Alberta has only

    a single road leading South. When fires erupted along that road the population was trapped, requiring a massive airlift rescue.
  19. Sinkhole Resiliency Even with the most central intersection of Ottawa

    closed due to a massive sinkhole, the transportation network had other routes and was resilient to failure.
  20. Data Center 2 0 A Typical Web App The Internet

    Host Machine Web Server Database Load Balancer / Proxy Job Server
  21. Data Center 2 1 A Resilient Web App The Internet

    Host Web Server Host Database Load Balancer / Proxy Host Job Server
  22. Data Center 2 2 A Resilient Web App The Internet

    Host Web Server Host Database Load Balancer / Proxy Host Job Server
  23. Data Center 2 3 A Resilient Web App The Internet

    Host Web Server Host Database Load Balancer / Proxy Host Job Server Host Web Server Hosts Web Servers Host Job Server Hosts Job Servers
  24. Data Center 2 4 A Resilient Web App The Internet

    Host Web Server Host Database Load Balancer / Proxy Host Job Server Host Web Server Hosts Web Servers Host Job Server Hosts Job Servers
  25. Data Center 2 5 A Resilient Web App The Internet

    Host Web Server Host DB Writer Load Balancer / Proxy Host Job Server Host Web Server Hosts Web Servers Host Job Server Hosts Job Servers Host DB Reader Host DB Standby
  26. Data Center 2 6 A Resilient Web App The Internet

    Host Web Server Host DB Writer Load Balancer / Proxy Host Job Server Host Web Server Hosts Web Servers Host Job Server Hosts Job Servers Host DB Reader Host DB Standby
  27. Data Center 2 7 A Resilient Web App The Internet

    Host Web Server Host DB Writer Load Balancers Host Job Server Host Web Server Hosts Web Servers Host Job Server Hosts Job Servers Host DB Reader Host DB Standby Load Balancers Load Balancers Edge Router Edge Router Also add multiple Internet Service Providers (ISPs)
  28. 2 8 Ok, NOW we’re done, right?

  29. 2 9 January 9, 2015 Amazon Data Center Fire Ashburn,

    Virginia
  30. Data Center 3 0 A Resilient Web App The Internet

    Host Web Server Host DB Writer Load Balancers Host Job Server Host Web Server Hosts Web Servers Host Job Server Hosts Job Servers Host DB Reader Host DB Standby Load Balancers Load Balancers Edge Router Edge Router
  31. 3 1 A Global, Scalable, Resilient Web Application

  32. 3 2 Data Center Host Web Server Load Balancers Host

    Job Server Host Web Server Hosts Web Servers Host Job Server Hosts Job Servers Host DB Standby The Internet Host DB Reader Load Balancers Host DB Writer Edge Router Edge Router Data Center Host Web Server Load Balancers Host Job Server Host Web Server Hosts Web Servers Host Job Server Hosts Job Servers Host DB Standby Host DB Reader Load Balancers Host DB Writer Edge Router Edge Router A Global Scale Resilient Web App CDN
  33. Content Delivery Networks We can store copies of things that

    don’t change in servers all over the world
  34. 34 2 DATA CENTERS 1090 SERVERS (HOSTS) Shopify Core Application

    1,000,000,000 DAILY WEB REQUESTS 60+
  35. 3 5 • Web scale architecture is largely about dealing

    with failure and chaos • Redundancy is heavily used to let failures happen without bringing the whole system down • Production or Infrastructure Engineers build and maintain large scale resilient computer systems Summary