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.
| Restaurant | Website | What it does |
|---|---|---|
| Dining room, menu | Frontend | What you see and click |
| Waiter | API | Carries requests back and forth |
| Kitchen | Backend | Does the actual work |
| Store room | Database | Where everything is kept |
Walking through one click
You click "My Orders" on a shopping site.
- 1Frontend (the page in your browser) notices the click.
- 2It sends a request to the API: "orders for user 4471, please."
- 3The backend on a server receives it, checks you're really logged in, and asks the database.
- 4The database returns 12 rows of order data.
- 5The backend formats them and sends them back.
- 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.
Your score is saved to your dashboard.
Finished reading? Tick it off.
Create a free account to save your progress, streak and badges.
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.