Frontend vs backend: the difference explained simply
What is frontend and what is backend? A restaurant analogy, a step-by-step look at what happens when you press Submit, and who builds which part of an app.
Frontend is the part of an app you see and click: the screens, buttons and forms in your browser or on your phone. Backend is the part that runs on a server: it checks rules and permissions, does the calculations and saves data to the database. Between them sits an API, the agreed way the frontend asks the backend for something. Written for business owners who hear these words in meetings.
Quick answer
- Frontend is what the user sees. It runs in the browser or a mobile app, on the user’s device.
- Backend is what the user doesn’t see. It runs on a server and decides what is allowed, what things cost and what gets saved.
- The database is where data lives permanently: customers, products, orders.
- The API is the waiter between them: it carries requests from the frontend to the backend and answers back.
- Rules and security checks must live in the backend, because the frontend is in the user’s hands.
How does an app work? The restaurant analogy
Picture a restaurant. The dining room is the frontend: tables, the menu and everything the guest sees. The kitchen is the backend: that’s where the food is actually prepared, following the house recipes and rules. The pantry is the database: ingredients stored in order, waiting. The waiter is the API: takes the order at the table, carries it to the kitchen and brings back a plate or a message like “no fish today”.
Guests never walk into the kitchen or the pantry, so the restaurant can check what is available and what it costs. An app works the same way: the user never talks to the database directly. How the same kind of waiter connects two different systems, say a web shop and accounting software, is covered in API integration: how it works.
Frontend vs backend vs database compared
| Frontend | Backend | Database | |
|---|---|---|---|
| What it is | Screens, buttons, forms | The app’s logic on the server | Permanent data store |
| Where it runs | In the user’s browser or phone | On a server or in the cloud | On a server, next to the backend |
| What it does | Shows data and takes input | Checks permissions, calculates, applies rules | Stores and returns data, rejects invalid input |
| In the restaurant | Dining room and menu | Kitchen | Pantry |
| Common technologies | HTML, CSS, JavaScript, React; for mobile Swift, Kotlin, Flutter | Node.js, Java, Python, PHP, C# | PostgreSQL, MySQL, Microsoft SQL Server |
| Who builds it | Frontend developer | Backend developer | Backend developer; on larger systems also a database specialist |
What a database is exactly and how it differs from a spreadsheet is explained in what is a database.
What happens in the second after you press “Submit”?
An illustrative example. A café orders through a wholesaler’s B2B portal: 10 cartons of paper cups, 4 packs of 1 kg coffee and 2 boxes of sugar sachets. The café has an agreed 8% discount on coffee, and only one box of sugar is left in stock. The customer presses “Submit order”.
| Step | Where it happens | What can go wrong |
|---|---|---|
| 1. Form check: quantities above zero, delivery address selected | Frontend | Empty field: a message shows at once, nothing is sent |
| 2. The order travels to the server: customer, three lines, quantities | API, between frontend and backend | No internet or the server doesn’t answer, so the order never arrives |
| 3. Who is sending this, and may they order for this company? | Backend | Session expired: the user has to log in again |
| 4. Prices and the 8% coffee discount are read from the database and calculated | Backend and database | The rule was entered wrongly, so the discount comes out wrong |
| 5. Stock check: 1 box of sugar left, 2 requested | Backend and database | Two customers grab the last box at once; the database lets only one sale through |
| 6. The order, three lines and new stock level are saved in one go | Database | A failure halfway: the database rolls everything back, nothing is half-saved |
| 7. The answer comes back: “Order received, 1 box of sugar backordered” | Backend, API, frontend | The answer gets lost, the customer clicks again and a duplicate order appears unless the backend recognises it |
The frontend is busy only at the start and the end. Everything that decides money and goods happens behind the screen. We build portals like this, every layer of them, as part of our app development work.
Who builds the frontend and who builds the backend?
A frontend developer builds what the user sees and makes it work well on phones and computers. A backend developer writes the rules, permissions, calculations and database work, and connects the app to other systems. A full-stack developer does both, which is common on smaller projects.
A designer decides how screens look and flow; the frontend developer turns that design into code.
Why should a business owner care?
Where a bug lives. If a button is in the wrong place, that’s frontend. If a discount is calculated wrongly, it’s almost always the backend or a value in the database. When you report a bug, “wrong amount on order 1042” points the team to the right place.
Why a “small change” isn’t always small. Say you want to add a “customer PO number” field to the order form. On screen it’s one field. Behind it, the database needs a new column, the backend must validate and save it, the API must carry it, and it likely belongs on the confirmation email and delivery note too. The visible part is often the smallest.
Security belongs in the backend. Anything that runs in the browser can be changed by the user. If the discount is checked only in the frontend, a savvy user can claim a discount they don’t have. So the backend re-checks prices, permissions and stock every time.
A website often has only a frontend, while an app with logins and orders needs all three layers. More on that difference in website vs web application.
Frequently Asked Questions
Is the database part of the backend? Usually, yes, because only the backend talks to it. Technically it is a separate system, and on larger apps a specialist looks after it.
Does a mobile app have a backend? Yes, as soon as it remembers users or shares data. The app on the phone is the frontend, and the backend on the server is often the same one that serves the web version.
Which is harder, frontend or backend? Neither is easier. Frontend needs a feel for users and many devices; backend needs accuracy, security and care with large amounts of data.
Do I need separate frontend and backend developers? For a smaller app, one full-stack developer is often enough. Larger systems split the roles.
Related Articles
- API integration: how it works and how to connect to an API
- What is a database? Database vs spreadsheet explained
- Website vs web application: what is the difference?
Thinking about an app for your customers or team?
We help you decide what belongs on the screen and what belongs behind it, and build an app where the rules and security sit where they should.
Get in touch at [email protected] or through the form on our site.