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
- Load balancers↗ Enterprise networkingA load balancer sends each app request to one of many backend servers, so no single server is overloaded.
- Servers↗ Data centresServers in a data centre run an app's backend: the code that stores orders and checks logins.
- AI app builder↗ AI codingAn AI app builder writes the backend for you: the database, the user logins and the payment code.