Backend for Frontend
A small backend service built for one specific frontend, which gathers data from other services and shapes it exactly for that frontend’s screens.
In more detail
A web dashboard needs different data than a mobile app, so each gets its own BFF instead of one generic API. The BFF calls several services in parallel, combines the results into view models and can degrade gracefully when one of them fails.
Related terms
- API gateway — A server that sits in front of one or more services and handles shared concerns such as routing, authentication, rate limits and TLS for every request.
- view model — Data shaped exactly for one screen, with the field names and values the frontend needs and nothing else.
- graceful degradation — Continuing to work with reduced features when part of the system fails, instead of failing completely.
- aggregation — Combining data from several sources into one response.
Taught in
- Resilient Error Handling: Problem Details & Envelopes — Production Full-Stack Engineering
- API Gateway & BFF Patterns: Backend-for-Frontend — Production Full-Stack Engineering
- Kubernetes Ingress, Routing & TLS Termination — Production Full-Stack Engineering