Opscraft
DevOps from zero · Lesson 2 of 6 · 4 min read

What happens when you open a website

The journey of one request

Typing shop.example.com and pressing Enter starts a chain of steps that usually finishes in well under a second. Every step is something a DevOps engineer builds, monitors or debugs.

  1. DNS lookup. Computers talk using IP addresses (numbers like 203.0.113.10), not names. The browser asks a DNS resolver: "What is the IP address of shop.example.com?"
  2. TCP connection. The browser opens a connection to that IP address on port 443 (the standard port for HTTPS). TCP makes sure data arrives complete and in order.
  3. TLS handshake. The browser and server agree on encryption keys, and the server proves its identity with a certificate. This is the padlock in the address bar.
  4. HTTP request. The browser sends a request such as GET /products.
  5. Load balancer. Big sites run many copies of their application. A load balancer receives the request and passes it to a healthy copy.
  6. Application server. Your company's code runs, often asking a database for data ("which products are in stock?").
  7. Response. The server replies with a status code (200 means OK, 404 means not found, 500 means the server failed) and the page content.
  8. Rendering. The browser draws the page, and usually makes more requests for images, styles and scripts.
Enlarge diagramBrowserDNSresolverLoadbalancerApp serverDatabase1. IP address ofshop.example.com?203.0.113.102-3. connect (TCP) andset up encryption (TLS)4. GET /products5. pass to ahealthy server6. queryrows7. 200 OK + page200 OK + page8. draws the page
Figure 1. What happens in the half-second after you press Enter on shop.example.com.
Swipe sideways to see all of it, or tap to open it full screen.

Where each piece runs

Enlarge diagramAPP SERVERSCDNimages, CSS,scriptsLoad balancerspreads requestsapp copy 1your codeapp copy 2your codeapp copy 3your codeDatabaseprimaryReplicastandby copyMonitoring and logsrequest rate, errors and response time from every part aboveUserscopies data
Figure 2. A typical small web system. Every box is something a DevOps engineer creates, secures and monitors.
Swipe sideways to see all of it, or tap to open it full screen.
  • A CDN (content delivery network) keeps copies of images and static files in data centres close to users, so they load quickly.
  • The load balancer spreads traffic and stops sending requests to servers that fail health checks.
  • Application servers (or containers) run the code. There are several, so one can fail without taking the site down.
  • The database stores the data. It is usually the hardest part to scale and the most important to back up.
  • Monitoring watches all of it: how many requests, how many errors, how slow.

Why this matters for DevOps

When someone says "the site is down", this journey is your checklist. Is DNS answering? Can you connect? Is the certificate valid? Is the load balancer seeing healthy servers? Is the app erroring? Is the database slow? The networking, DNS, TLS, HTTP, AWS and Kubernetes topics on this site each go deep on one part of this picture.