BFF is a layer that sits between the clients and the backend.
Every type of client has a dedicated BFF; for example, Desktop Web has its own BFF, while Mobile has its own.
Depending on the request, the BFF then talks to the backend, grabs the data, filters out the unnecessary fields, and responds.
https://www.linkedin.com/pulse/bff-backend-frontend-pattern-microservices-arpit-bhayani/
Backends for Frontends pattern basically separate API Gateways as per the specific frontend applications. So we have several backend services which’s are consumed by frontend applications and between them we put API Gateway for handling to routing and aggregate operations.
But this makes a single-point-of failure. So In order to solve this problem BFF offers to create several API Gateways and grouping the client applications according to their boundaries and split them different API Gateways.
A single and complex API Gateway ca be risky and becoming a bottleneck into your architecture. Larger systems often expose multiple API Gateways by grouping client type like mobile, web and desktop functionality. BFF pattern is useful when you want to avoid customizing a single backend for multiple interfaces.
So we should create several API Gateways as per user interfaces. These API Gateways provide to best match the needs of the frontend environment, without worrying about affecting other frontend applications. The Backend for Frontends Pattern provides direction for implementing multiple gateways.
Look at the image. There are 3 API Gateways, one for the Web, one for the Mobile, another for the Desktop applications.
So with following “Backend for Frontend” (BFF) pattern, we have created 3 API gateways that can provide a different APIs tailored for each client application type.
For example, in this image, mobile client needs different API requirements and can be developed specific APIs into API Gateway Mobile services. In example of different requirements, you can think product listing page, and think that listing products, paging, sorting can be differentiate some specific cases.
As you can see that we have understand the Backends for Frontends pattern, so now we can apply this pattern in our e-commerce architecture.
Backends for Frontends (BFF) is a software architecture pattern that involves creating separate backend services for each of your frontend clients.
This means that instead of having a single backend that serves all of your frontend applications, you would have a separate backend for each of your frontend apps.
The idea behind this pattern is to provide each frontend with a backend that is tailored specifically to its needs, which can improve the performance and user experience of the frontend app.
Additionally, having separate backends for each frontend can also help to reduce complexity.
https://www.linkedin.com/pulse/bff-backend-frontend-pattern-microservices-arpit-bhayani/