Tech, ExplainedNetworking, infrastructure and security
Concept

Backend

The part of the app you never see.

HOW IT WORKSThe user taps a buttonin the appThe app sendsa request overthe internetto the backendThe backend checkswho the useris and appliesthe app's rulesIt reads or writes thedatabase, and may callother servicesIt sends the answerback, and the appshows itThe screen only shows results; the decisions and thedata stay on servers that the user cannot change.HOW IT WORKSThe user tapsa button inthe appThe app sendsa requestover theinternet tothe backendThe backendchecks whothe useris andapplies theapp's rulesIt reads orwrites thedatabase, andmay callotherservicesIt sends theanswer back,and the appshows itThe screen only shows results; the decisions and thedata stay on servers that the user cannot change.HOW IT WORKSThe user taps a button in the app↓The app sends a request over the internetto the backend↓The backend checks who the user is andapplies the app's rules↓It reads or writes the database, and maycall other services↓It sends the answer back, and the appshows itThe screen only shows results; the decisions and the datastay on servers that the user cannot change.
A tap in the app sends a request to the backend, which checks the user, applies the app's rules, reads or writes the database and sends the answer back to the screen.
opens a page inside this one a page in the same scene a page in another scene a concept page a label only, with no page

The backend is the part of an app that you never see: the code, servers and databases that store the data and run the app's rules. The part you see and touch, the screens on your phone or in your browser, is called the frontend. When you log in, search, book or pay, the frontend only shows the result. The backend does the work.

Here is how it works in general. You tap a button in the app. The app sends a request over the internet to the backend, through an API, a defined way for one program to ask another to do something. The backend first checks who you are. It then applies the app's rules, called business logic, such as whether a coupon is still valid or whether a seat is still free. It reads or writes the database, where the app's records are kept. It may also call other services, such as a payment gateway or an SMS provider. Finally, it sends the answer back, and the app shows it on your screen.

A popular app's backend handles millions of requests a day, from many users at the same moment. So it does not run on one computer. It runs on many servers, usually rented from a cloud provider, in a data centre. A load balancer spreads the requests across copies of the same code, so that one failed server does not stop the app. Cloud hosting describes how a small team rents all of this.

Take, for example, a train ticket app on the day bookings open. Thousands of people tap "Book" for the same train within seconds, and only the backend can decide who gets each seat.

Consider the balance shown in a banking app. The number is stored in the bank's own systems, and the app shows only what the backend sends. This is also why rules such as prices must be checked on the backend: anyone can change the copy of an app on their own phone.

Say a founder with no engineers wants an app for taking orders. An AI app builder creates the screens, the backend and the database together from a plain description.

How is the backend different from the cloud? The backend is the app's own code and data. The cloud is one place where that backend can run, on servers rented from another company. A developer who works on both the frontend and the backend is called a full-stack developer.

Appears in

Networking, infrastructure and security
Cloud platforms and developer tools
Tech, Explained is a part of ingrid.fyi. Every page explains one piece of technology in plain words.