API integration ‒ Backend for frontend
The Backends for Frontends
(BFF) pattern
Unlike a traditional service, a BFF doesn't not follow a domain model. Instead, it's an API layer for the micro-frontend to preprocess data before it reaches the client. Areas where this is useful include the following:
-
Authorization toward private APIs
-
Aggregation of data from different sources
-
Transformation of data to reduce network load and to ease the consumption of data by the client
As such, a BFF is owned by the micro-frontend, not by the domain service tier. BFFs can be deployed by using the following:
-
AWS AppSync GraphQL APIs
-
A set of AWS Lambda functions
-
As a container running on Amazon ECS, Amazon EKS, or AWS AppRunner
The following diagram shows that without the BFF pattern, micro-frontends must connect to individual microservice API endpoints to fetch and aggregate data.

Instead, with the BFF pattern in the following diagram, micro-frontends can communicate with their own backend and fetch aggregated data.

Teams can develop BFFs for different channels such as mobile, web, or specific views, with requirements to optimize backend interactions by reducing chattiness.