Topic 32

Front End and Back End

Concept

Most apps you use have two halves. There's the part you see and tap — the buttons, the text, the photo that loads — and there's another part you never see, running on a server far away, doing the work behind it. The screen in front of you is only half the software.

These two halves have names that turn up constantly. The part you see is the front end; the hidden part on the server is the back end. Once you can tell which is which, a great deal of how software is built — and how people talk about it — falls into place.

Two halves of one app
Front end
Runs on your device, in your browser or app. The part you see and touch — buttons, text, images, layout.
Back end
Runs on the server, out of sight. Holds the shared data, enforces the rules, and answers what your device asks for.

The Front End: What You See

The front end is everything that runs on your own device — in your web browser, or inside an app you installed. It's the part you actually look at and interact with: the layout of the page, the buttons, the menus, the photo that appears when it finishes loading. When you open example.com and a page draws itself on your screen, the browser is running that site's front end right there on your machine.

Its job is presentation. The front end takes information and turns it into something a person can read and click — arranging it on screen, responding when you tap, showing a spinner while it waits. But it doesn't, on its own, hold the real data. It's a window onto the back end, not the place where things are truly kept.

The Back End: What Runs Out of Sight

The back end is the half that runs on a server — that always-on computer in a data center from the previous topic — where you never see it. When your front end needs something real, it asks the back end, and the back end is what actually has the answer.

This is where the genuine work lives. The back end holds the shared data — every user's account, every order, every message — and it enforces the rules: checking your password, confirming there's enough money in the account, making sure two people don't book the same seat. None of that can safely happen on your device alone, so it happens on the server, the same for everyone.

Why Split It in Two?

The split exists because of one stubborn fact: the important data has to be shared, and your device is just yours. Your phone can't be trusted to hold the master copy of everyone's bank balance, and it certainly can't be the single place a million people's messages are kept. That has to live in one shared place — the back end — that every device talks to.

A restaurant makes the divide concrete. The dining room is the front end: the tables, the menus, the plated food — everything a guest sees and interacts with. The kitchen and the storeroom are the back end: out of sight, holding all the ingredients and doing the actual cooking. Guests never walk into the kitchen; they place an order and a finished dish comes back. The dish is presented in the dining room, but it was made — and the ingredients are kept — in the back.

So the labor divides cleanly. The front end on your device handles how things look and feel; the back end on the server handles the shared data and the rules everyone must follow. Each does the part it's suited for, and neither tries to do the other's job.

How the Two Halves Talk

The front end and the back end live on different computers, often thousands of miles apart, so they talk over the network using the same request-and-response pattern from the web chapter. Your device sends a request — "show me this page," "log me in," "save this order" — and the back end sends a response with the answer.

That's the full loop behind almost every app. You tap something; the front end sends a request to the back end; the back end checks the rules, reads or updates the shared data, and sends a response; the front end takes that response and redraws the screen. The screen feels instant, but a round trip to a distant server happened in between.

Common Confusions
  • "It all runs on my device." Only the front end does. The shared data and the real rules run on the back end, on a server you never see.
  • "The back end is just the database." The database is part of the back end, but the back end also includes the code that checks rules and decides what to send back. The next topic covers the database itself.
  • "Front end means the front page." Front end isn't one page — it's every part of the app that runs on your device, however deep into it you go.
  • "The back end is where I see the admin settings." Even an admin screen is still front end. "Back end" means running on the server, not "the advanced part of the interface."
Why It Matters
  • "Front-end developer" and "back-end developer" name two of the most common jobs in software — this is the split those titles describe.
  • It tells you where things actually live: your screen shows it, but a server holds it — which is why your data is still there when you log in on a new phone.
  • Almost every web, cloud, and DevOps course you might take is organized around this divide, so naming it once pays off across the whole catalog.
  • It sets up the next topic: the shared data the back end guards has to be stored somewhere built for it — a database.

Knowledge Check

Which best describes the front end of an app?

  • The part that runs on your device and that you see and tap
  • The place on the server where everyone's shared data is kept
  • Only the very first page of a website, before you log in
  • The code on the server that checks your password and the rules

Why does the back end run on a server instead of on your device?

  • The data and rules are shared, so they belong in one place every device reaches
  • Because a server in a data center is quicker for you to reach than your own phone
  • Because your own device cannot draw the buttons, images, or layout by itself
  • Because the back end is only a spare copy of the front end, kept around for backup

You tap "save" on an order in an app. How do the two halves work together?

  • The front end sends a request; the back end updates the data and responds
  • The order is kept only on your own device and never leaves it for the server
  • The back end reaches across the network into your screen and changes it directly
  • The front end stores the order for every user on its own, with no server involved

You got correct