DeskFluent
Module 1Free7 min read

How a website actually works

Frontend, backend, database and server, explained with a restaurant. You will understand tech conversations after this.

When you open a website, four things are involved. The clearest way to see them is a restaurant.

RestaurantWebsiteWhat it does
Dining room, menuFrontendWhat you see and click
WaiterAPICarries requests back and forth
KitchenBackendDoes the actual work
Store roomDatabaseWhere everything is kept

Walking through one click

You click "My Orders" on a shopping site.

  1. 1Frontend (the page in your browser) notices the click.
  2. 2It sends a request to the API: "orders for user 4471, please."
  3. 3The backend on a server receives it, checks you're really logged in, and asks the database.
  4. 4The database returns 12 rows of order data.
  5. 5The backend formats them and sends them back.
  6. 6The frontend turns that data into the list you see.

All six steps in about 200 milliseconds.

The words you'll hear in meetings

The three languages of the frontend

If you ever peek at a web page's code, you'll meet these:

  • HTML β€” the structure. "This is a heading, this is a paragraph, this is a button." Like the skeleton.
  • CSS β€” the appearance. "Headings are blue and 24 pixels." Like the clothes.
  • JavaScript β€” the behaviour. "When this button is clicked, show that box." Like the muscles.

Why does a website ever go down?

Now you can reason about it properly:

  • Server is overloaded β€” too many people at once. The kitchen has too many orders.
  • Database is slow β€” one query is taking forever. The store room is disorganised.
  • A deploy went wrong β€” new code was released and broke something.
  • Your internet β€” everyone else can see the site fine.

Being able to ask "is it the frontend or the backend?" in a meeting will get you taken seriously immediately β€” because it's the question that halves the problem.

Too Long; Didn’t Read

  • Frontend is the dining room, backend is the kitchen, database is the store room, API is the waiter.
  • The frontend is built from HTML (structure), CSS (appearance) and JavaScript (behaviour).
  • Knowing these four parts lets you ask "is it the frontend or the backend?" β€” the question that halves any problem.

Your tiny task

Open any website and press F12 to see its code. Find the HTML for one heading and change the text. It only changes your own screen and resets on refresh β€” so break it freely.

It takes a few minutes and it’s the bit that makes the lesson stick.

Quick check

0 of 3 answered

Three questions. Get one wrong and you’ll get a hint β€” there’s no penalty and you can try again straight away.

  1. In the restaurant analogy, what is the database?
  2. Which language controls how a web page looks?
  3. What is an API?

Your score is saved to your dashboard.

Finished reading? Tick it off.

Create a free account to save your progress, streak and badges.

Next lesson

Up next: Building things without writing code

Advertisement

Ad space (lessonFooter)

Add your AdSense IDs to .env and real ads appear here.

Ads keep the free courses free. Go Pro to remove them.