The Client-Server Model: What Happens When You Visit a Website

~11 min read

A client asks for something; a server provides it. Your browser is a client, the website's machine is a server — nearly every AI app you'll build follows this exact same two-role split.

The Client-Server Model: What Happens When You Visit a Website is a Pro topic

Sign in, then upgrade to Pro or Power to unlock this topic and the full AI Engineering curriculum.

Key points

  • A client initiates requests (browser, mobile app, API-calling script); a server waits for and responds to them — the same request/response roles from api-basics, now about machines
  • Typically many clients connect to far fewer servers, which is why servers are usually powerful always-on machines while clients can be anything
  • Visiting a website: DNS lookup finds the server's address, the browser (client) sends a request, the server does the work and sends back a response to render
  • 'Frontend' and 'backend' are the web-development near-synonyms for client-side and server-side code respectively
  • AI apps follow the same split: your frontend is what the user interacts with; your backend is a separate program that actually calls the LLM API