What is a backend?

Author: Published

In brief: The backend is the part of an application that runs on the server: it processes requests, applies the rules governing the service and controls access to data. It is responsible, for example, for checking passwords, saving orders and providing purchase histories. Users usually do not see it directly, but access its functions through a website or mobile application.

Backend vs frontend — what is the difference?

The frontend is the part of an application that users interact with directly: forms, buttons, menus and data views. On a website, it runs primarily in the browser. The backend receives requests sent from the browser and decides what can be done with them.

In a login form, the frontend displays fields for an email address and password. The backend checks the credentials and, after a successful login, allows the user to be recognised in subsequent requests. Simply displaying a “Logged in” screen does not grant access to an account — that access must be controlled on the server side.

This division does not mean that every project has two separate applications. The backend can also generate ready-to-display page code, which the browser then renders. In other setups, it mainly sends data, and the frontend builds the view from that data itself.

What is the backend responsible for?

The backend’s most important task is implementing business logic, meaning the rules that govern how a service works. In a shop, these may determine whether a discount code applies to a particular product; in a booking system, they may determine whether the selected slot is still available.

Typical backend responsibilities include:

Frontend validation can make a form easier to complete, but it does not replace backend validation. A request can be sent without using the form, so the server should not unconditionally trust prices, account identifiers or permission information received from a user.

How does the backend work during a purchase?

Imagine you are buying the last copy of a book in an online shop. After you click “Place order”, the application has to do more than simply change what appears on the screen.

  1. The frontend sends a request to the backend with the product identifier, quantity and necessary order details.
  2. The backend checks the book’s availability and calculates the amount due using trusted pricing and discount data.
  3. It saves the order and safeguards inventory levels appropriately so that simultaneous purchases do not result in the same copy being sold to two people.
  4. In a typical purchase with online payment, it communicates with the payment provider and sends the frontend the information needed for the next step.
  5. After receiving and verifying payment confirmation, it updates the order status.

An API, or application programming interface, defines how this communication works: which requests can be sent and what the responses look like. Through an API, the same backend can serve both a browser-based shop and a mobile application. However, an API is not a synonym for the backend — it is a way of making the backend’s functions available.

A backend, server and database are not the same thing

A server can mean a computer that provides resources or a program that responds to requests. The backend is the part of an application running on this infrastructure. It does not have to reside on a single physical device: it can use multiple machines or cloud services.

A database is a system for storing and retrieving information in an organised way. The backend uses it, for example, to save a customer account, but the database itself does not replace the rules governing who can edit that account. Nor does every backend need its own database — some services process data as it comes in or retrieve it from other systems.

Backends can be built using Python, Java, PHP, C# or JavaScript running in Node.js, among other options. The choice of language does not automatically determine an application’s quality. The team’s experience, available libraries, required integrations and maintenance costs also matter when making that decision.

When do you need your own backend?

A simple brochure website with a description of services and contact details can work without its own application backend. The hosting service still delivers files to the browser, but it does not have to execute individual logic for each visitor. A contact form, meanwhile, can be handled by an external service — in that case, its provider supplies the necessary backend.

User accounts, private documents, bookings and custom billing usually require backend functionality. This does not mean everything has to be written from scratch: a ready-made ecommerce platform or content management system may already offer it. A custom solution makes sense primarily when the available tools do not implement important project rules.

Before commissioning an application, list what data it needs to store, who can change it and which services it must connect to. This list will help you assess whether a ready-made platform is sufficient or whether you need to design your own backend.

See also: What is 2FA?

Read also

Learn how PHP-FPM handles PHP requests, how it differs from a web server, and how to tune processes for traffic and hosting resources.
Learn how BIND, open-source DNS server software, handles domains, how its two roles differ and when running it yourself makes sense.
Learn what Poland’s REGON register and identification number mean, how they differ from NIP and KRS, and how to check a business’s details.