Backend development: What happens between a request and a response?
Learn how a backend handles a client's request, applies service rules, reads data, and returns a response, plus what to inspect when something fails.
Backend development builds the server-side features that receive a user's request, apply application rules and data, and return a result. Separating the roles of the web server, application code, and data store makes the path from a request to a screen easier to understand.
What the backend includes
A browser or mobile app is a client: it displays a screen and accepts input. When it sends an HTTP request, a server can return a file or run application logic and respond. “Server” can mean one computer or a system made of several servers and intermediary layers. MDN's HTTP overview
A web server is software that accepts HTTP connections, serves static files, or forwards requests to an application. Application logic runs service rules such as sign-in, price calculation, and permission checks. A database stores and retrieves information such as accounts, products, and orders. These roles can be combined in one program or split across services, so focus on each component's responsibility rather than its label. MDN: What is a web server?
Following one request
Suppose an app asks for a product's details. This is an illustrative flow; not every backend uses the same structure.
The client sends `GET /api/products/42`. The request may include headers with authentication information or the desired response format.
A web server or gateway forwards it to the appropriate application. Depending on the system, this layer may handle TLS termination, rate limits, logging, or routing.
The application checks the request format, authentication, and authorization, then applies the product lookup rules. Authorization asks both whether the user is signed in and whether that user may access the product or perform the operation.
If needed, the application reads product data from a database. A missing product, invalid input, and storage outage should be treated as different outcomes.
The application builds an HTTP status code, headers, and body. The client interprets the response to update the screen or show an error.
HTTP is a protocol for exchanging requests and responses. Messages can contain a method, path, headers, and an optional body, or a status code in the response. Connection details and internal architecture depend on the HTTP version and system design, but the basic way to inspect a request's meaning and response remains useful. MDN: HTTP overview and flow
What to check when designing a backend
**Validate input:** Check format and allowed values on the server. Client-side checks improve convenience but do not replace server validation.
**Separate authentication and authorization:** Identify the requester, then independently decide whether that requester may perform the requested action.
**Make failures distinguishable:** Separate invalid input, authentication failure, missing data, and temporary dependency outages so clients can choose a next step. Do not expose secrets or stack traces in public responses.
**Plan data consistency:** Decide what is stored, whether multiple changes must succeed together, and whether retries could create duplicate work.
**Observe operation:** Record request IDs, structured logs, latency, and error metrics so incidents can be traced. Never log secrets such as passwords or tokens.
Inspect a request yourself
Open the browser's developer tools, select the Network panel, reload the page, and inspect a request's URL, method, status, headers, and response body. For a public API, a command such as curl -i https://api.example.com/products/42 displays response headers as well. example.com is illustrative; replace it with the real API address. Do not send invented credentials to an authenticated service.
If a request fails, first check the URL and method sent by the client, then the response status and body. Find the same request in application logs and narrow down whether it failed during validation, authorization, data lookup, or a dependency call. Do not infer the cause from a status code alone; consider the response and server-side record together.