In service-oriented distributed architectures, the Backend for Frontend (BFF) pattern, initially popularized by Sam Newman, emerges as a response to the constant tension between two opposing needs:
- The backend's need to expose generic, cohesive services centered on the business domain.
- The frontend's need (web, mobile apps, kiosks, or B2B integrations) to consume compact, aggregated payloads optimized for a specific user interface or device.
Trying to meet both demands with a single "shared public API" layer usually leads to two classic problems: network overhead on mobile devices (over-fetching / under-fetching) or endpoints coupled to particular views that end up degrading the design of the core microservices.
1. The Problem: The Single General-Purpose API
Let's imagine a standard omnichannel flow (for example, the customer detail in checkout or CRM):
- Mobile App: Needs to render quickly on unstable 4G/5G connections. It needs the customer's name, their points balance, and their last 3 orders. It wants a minimal payload (< 10 KB) in a single HTTP/2 call.
- Desktop Web Portal: Has more bandwidth and screen space. It additionally needs the full billing history, saved tax addresses, and notification preferences.
What happens without a BFF?
- "One microservice per view" strategy: The mobile client makes 4 or 5 chained calls (
/users/{id},/loyalty/{id},/orders?limit=3,/discounts). This multiplies latency by the sum of the RTT (Round Trip Time) of each connection over mobile networks. - "Multipurpose monolithic endpoint" strategy: An endpoint is created in the central backend that returns everything. The mobile app discards 70% of the data received (over-fetching), needlessly consuming battery and data allowance.
2. Solution Topology: BFF + API Gateway
The BFF pattern introduces an intermediate layer where each user experience has its own consumption backend, ideally maintained by the same team that builds the client interface.



