Login
Login
DNSServerDatabaseCDNAPIStorage
A free guide by Olitt

Web hosting diagram:
how a website actually works

The most beginner-friendly web hosting diagram on the internet — a long, illustrated tour through every piece that powers a website. Hover, click, and watch a real request travel from browser to database in 300 milliseconds.

10+
sections
5
layers
300ms
the magic

Written by Mysson · Digital Marketing & AI Automation Lead at Cloudoon — the team behind Olitt, Truehost & Cloudpap

The big idea

A website is just a very fast restaurant

Forget jargon for a second. If you've ever ordered food, you already understand 90% of how a website is hosted. Here's the same idea in two languages.

The hungry guest = Browser & device

They walk in with an order — they don't care how the kitchen works, they just want a great meal, fast.

The address book & local pantry = DNS & CDN

DNS tells the guest which restaurant to go to. The CDN keeps popular dishes pre-made nearby so the guest is served instantly.

The dining room = Frontend

What the guest actually sees and touches — the menu, the plates, the experience. Beautiful but doesn't cook.

The kitchen = Backend / API

Where the real work happens. Reads the order, follows the recipe, plates the dish, and sends it out.

The walk-in fridge = Database & Storage

Holds every ingredient the kitchen needs. Organized, labelled, and stocked so the chef can find anything in seconds.

The whole picture

The interactive web hosting diagram

Here's every moving part of a modern website on one screen. The animated request starts automatically — hover for hints, click any block for the full story, or use the controls to replay the flow.

ClientNetworkComputeDataServices

Tip: hover any block for a quick hint, click for the full story, or hit Play to watch a request travel.

The journey of a click

What actually happens in 300 milliseconds

Every time you load a webpage, ten or more systems coordinate in a fraction of a second. Here's the trip — slowed down so you can watch it.

  1. 00ms

    You click a link

    Your browser receives a URL like example.com/blog. It now needs to find the computer that owns this name — somewhere in the world.

  2. 20ms

    DNS lookup begins

    Your computer asks a DNS resolver: 'Who is example.com?' The resolver replies with an IP address — the internet equivalent of a postal code.

  3. 60ms

    The CDN catches the request

    Before reaching the origin server, the request hits a CDN edge node nearby. If a cached copy exists, it's returned in milliseconds. Game over, page loaded.

  4. 120ms

    HTML, CSS, JS arrive

    The browser downloads the page's building blocks. It starts painting layout, applying styles, and running JavaScript to make things interactive.

  5. 180ms

    JavaScript calls the API

    For dynamic content (your name, your orders), the frontend asks the backend. A load balancer routes the request to whichever server is least busy.

  6. 210ms

    Backend reads the database

    The backend authenticates you, checks the cache, and queries the database for fresh data. Files (avatars, uploads) come from object storage.

  7. 260ms

    Data flies back

    The backend bundles a JSON response and sends it back through the load balancer, across the internet, into your browser.

  8. 300ms

    You see the page

    The browser slots the new data into the page. Total trip: about a third of a second. You think: 'huh, fast.' Behind the scenes: a small miracle.

The five layers, in depth

Every web app, no matter how big, lives in these five layers

Whether you're running a tiny blog or a global SaaS, the architecture rhymes. Here's the long version of each layer — what it does, why it exists, and the questions beginners always ask.

Client layer

The Client — where every story begins

The client is whatever device a person uses to reach your site. A phone on a subway. A laptop on hotel Wi-Fi. A tablet at the kitchen table. You don't control the client — you can only design for it. Network speed, screen size, browser quirks, and battery life all shape the experience before your code even runs.

Q Why does my site feel slow on mobile?

Phones run on slower CPUs and flaky networks. Heavy JavaScript and big images hit them hardest.

Q Is the user's browser really my problem?

Yes. Different browsers render the same code slightly differently. Testing matters.

Network layer

The Network — getting bits across the planet

Between your visitor and your server is the entire internet — fiber under oceans, towers in fields, routers in basements. DNS turns names into addresses, and CDNs strategically place copies of your files near every major city. Done well, this layer is invisible. Done poorly, your site feels broken even when your code is perfect.

Q What's a CDN actually caching?

Static stuff: images, CSS, JavaScript bundles, fonts. Anything that doesn't change per user.

Q Why does DNS matter for SEO?

Slow DNS means a slow first byte, which Google notices and penalizes.

Compute layer

The Compute — where the thinking happens

This is the layer that runs your code. The frontend renders the page in the browser. The backend, sitting on a server somewhere, validates logins, runs business rules, and decides what data to send back. A load balancer in front lets you run many copies of the backend so a traffic spike or a crashed server doesn't take you down.

Q Frontend or backend — which matters more?

Both. The frontend shapes the experience; the backend protects the data.

Q Do I need a load balancer day one?

No. Most platforms add one automatically when you scale beyond a single server.

Data layer

The Data — the memory of your app

Computers forget things when they restart. Databases don't. They store every user, post, comment, and order in a structured way you can query. Caches sit alongside to speed up the most-asked questions. Object storage holds the big stuff — images, videos, uploads — that doesn't fit nicely in a database row.

Q Why split files from the database?

Databases are expensive per gigabyte. Object storage costs cents and scales infinitely.

Q What's a backup strategy?

Automated daily snapshots, off-site copies, and periodic restore drills. Untested backups don't count.

Services layer

External Services — standing on giants

Modern apps almost never reinvent email, payments, search, AI, or analytics. Instead, they call specialized services that do one thing extremely well. This means a tiny team can ship features that used to require entire departments — but it also means understanding what data leaves your system, and at what price.

Q Aren't external services a security risk?

Only if you give them more than they need. Pick reputable vendors and pass the minimum data.

Q What if a service goes down?

Build graceful fallbacks: queue retries, degrade features, and tell users honestly.

Where does your site actually live?

Five flavors of hosting, explained with houses

Hosting providers sell different ways of renting computers. Here's how the main options stack up — and what kind of project each one fits.

Shared hosting

Sharing a house with roommates

Strengths

  • Cheapest option
  • Easy to start
  • Provider handles upkeep

Trade-offs

  • !Slow if a neighbor hogs resources
  • !Limited control
  • !Not great for traffic spikes
Best for: Personal blogs, brochure sites, weekend projects.

VPS

Renting your own apartment

Strengths

  • Dedicated resources
  • Root access & flexibility
  • Predictable performance

Trade-offs

  • !You manage updates & security
  • !Costs more than shared
  • !One server = one point of failure
Best for: Growing sites, small SaaS apps, hobbyist developers.

Cloud / managed

A flexible serviced apartment

Strengths

  • Auto-scales with traffic
  • Pay for what you use
  • Built-in databases, storage, CDNs

Trade-offs

  • !Cost can surprise you
  • !Vendor lock-in is real
  • !Steeper learning curve
Best for: Most modern startups, SaaS, e-commerce.

Dedicated server

Owning the whole building

Strengths

  • Maximum power
  • Total control
  • Great for heavy workloads

Trade-offs

  • !Expensive
  • !You're responsible for everything
  • !Slow to scale up or down
Best for: High-traffic platforms, gaming, regulated industries.

Serverless / edge

Hiring a chef who shows up only when you're hungry

Strengths

  • Zero idle cost
  • Scales to millions instantly
  • Runs close to users globally

Trade-offs

  • !Cold starts on first hit
  • !Not ideal for long-running jobs
  • !Different mental model
Best for: APIs, side projects, modern web apps with spiky traffic.
Forget what you heard

Six hosting myths to stop believing

These come up in every beginner conversation. Here's the truth, with zero gatekeeping.

More expensive hosting = faster website

Speed comes from architecture, caching, and code quality. A $5 plan with a CDN often beats a $500 plan without one.

I need a dedicated server because I'm 'serious'

Most successful sites under a million monthly visitors run happily on shared cloud or serverless. Buy the smallest thing that works.

Hosting and domain names are the same thing

A domain is the address (yourname.com). Hosting is the building. You can change either one without losing the other.

Once it's live, the work is done

Hosting is a continuous practice: backups, security patches, certificate renewals, monitoring, and performance tuning never stop.

SSL certificates are optional

Browsers actively warn users away from sites without HTTPS. Free certs from Let's Encrypt make this a 5-minute fix.

If it works on my laptop, it'll work in production

Different OS, different network, different load. Always deploy to a staging environment that mirrors production before going live.

Speak the language

A plain-English glossary of every word you’ll hear

Tap any term to see the one-line summary, then expand for the longer story. No prior knowledge required.

Servers are just regular computers — usually without a screen — that run 24/7 in a data center. Instead of a person clicking around, they wait for requests from the network, do work, and send back replies.
Every device online has an IP address (like 142.250.72.46). DNS exists so humans can use names instead of these numbers.
HTTP is a simple set of rules for asking ('GET this page') and answering. HTTPS is the same, but encrypted so nobody can read or tamper with the messages in transit.
Where a webpage is for humans, an API is for software. Your frontend calls the API to fetch data, save things, or trigger actions — usually exchanging JSON.
HTML, CSS, JavaScript, fonts, images. The frontend is what users see and click. It runs on their device, not your server.
Business logic, authentication, database access, integrations with payment or email providers. The backend never trusts the frontend — it always validates.
Databases store structured data (users, posts, orders) and let you query it efficiently. They survive restarts, support backups, and enforce rules about what data is valid.
Caches keep recent answers in fast memory so you don't repeat expensive work. They're optional, but they make slow things feel instant.
Content Delivery Networks copy your static files to dozens of cities. Visitors in Tokyo download from Tokyo, visitors in Berlin from Berlin — making sites feel local everywhere.
DNS turns names like 'example.com' into IP addresses. It's distributed, cached, and surprisingly important — DNS outages take down huge chunks of the web every year.
Sits in front of multiple backend servers and distributes incoming requests evenly. Lets you scale horizontally and survive individual server failures.
Deploying means taking new code from your laptop and putting it onto the servers users actually hit. Modern platforms automate this — push to git, the platform builds and rolls it out.
Now what?

Your six-step launch checklist

You've made it through the whole tour. If you're about to put a site live, do these six things in order — and you'll be ahead of 90% of new launches.

  1. 01

    Pick the smallest hosting plan that works

    You can always upgrade. Start with managed cloud or shared hosting.

  2. 02

    Turn on HTTPS from day one

    Free with Let's Encrypt. Most modern hosts enable it with one click.

  3. 03

    Put a CDN in front of static assets

    Cloudflare's free tier alone makes most sites measurably faster.

  4. 04

    Set up uptime monitoring

    Free tools like UptimeRobot or Better Stack will text you if your site dies at 3am.

  5. 05

    Automate backups — and test them

    A backup you've never restored from is just hope, not a backup.

  6. 06

    Pick a host with humans you can reach

    When something breaks at midnight, you'll be very glad they answer.