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).

John Arthorne

June 20, 2016
Tweet

More Decks by John Arthorne

Other Decks in Technology

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. Data Center 4 A Trivial Web App The Internet Host

    Machine Web Server GET http://example.com/index.html 200 OK
  4. 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
  5. 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
  6. 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
  7. 1 2 The Internet is a chaotic place Billions of

    connected devices Global in scope Highly unpredictable Malicious attackers Out of control robots (bots)
  8. 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
  9. 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
  10. 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
  11. 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.
  12. 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.
  13. Data Center 2 0 A Typical Web App The Internet

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

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

    Host Web Server Host Database Load Balancer / Proxy Host Job Server
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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)
  21. 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
  22. 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
  23. Content Delivery Networks We can store copies of things that

    don’t change in servers all over the world
  24. 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