BFF (backend for frontend)
A small backend built for one client, such as the web app or the mobile app, that shapes data exactly the way that client needs it.
Instead of one generic API that every client stitches together with many calls, each client gets its own thin backend. It combines calls to internal services, trims the data, and handles login sessions so tokens stay off the device. Next.js route handlers or an edge worker are common homes for it. The cost is some duplicated logic across BFFs, so business rules belong in the services behind them.
Related terms
- API gateway: A single entry point in front of backend services that handles routing, authentication, rate limits and TLS for all of them.
- Microservices: An architecture where a system is built from small, separately deployed services, each owning its data and talking to the others over the network.
- Anti-corruption layer (ACL): A translation layer between your model and a legacy or external system, so its data shapes and quirks do not leak into your code.
