Video in progress

What happens at the system level when you type a site address into the browser and press Enter?

First DNS turns the domain name into an IP address, then comes the TCP connection and TLS handshake, then the HTTP request reaches the application server through a CDN or load balancer. The application hits the cache and database if needed and returns a response, and the browser renders the page.

📖 Answer

A short version from a backend developer's point of view:

  1. DNS. The browser, the OS and the ISP caches are checked; if there's no hit, DNS servers are queried. With a short TTL this step repeats often.
  2. TCP + TLS. The connection is opened and the certificate is verified. This takes several round trips — which is why HTTP/2 and keep-alive reuse the connection.
  3. CDN or edge. Static files are often returned from here and never reach the application at all.
  4. Load balancer. Sends the request to one of the healthy instances.
  5. Application. In Spring: filters (security), controller, service, repository.
  6. Cache / database. If it's in Redis, it's fast; if not, a query to PostgreSQL.
  7. The response goes back the same way, and the browser renders the HTML and requests the CSS/JS/images separately.

In interviews this question often comes with the follow-up "where can it get slow?". Every step takes time and each one can be measured — the Network tab in browser DevTools shows DNS, connection and waiting time separately.