1.API Gateway vs Backend-for-Frontend
An API gateway gives every client — web, mobile, third-party — the same shared entry point and the same response shape. A Backend-for-Frontend (BFF) is a separate backend layer per client type, each one shaped around what that specific client actually needs.
Key features
- An API gateway serves one shared contract to all clients — web, iOS, Android and third parties all call the same endpoints and get the same response shape
- A BFF is one backend per client experience (a web BFF, an iOS BFF, an Android BFF) — each one calls the same downstream services but returns a shape tailored to that client
- A BFF is typically owned by the same team that owns the client it serves, not by a central platform team
- A shared gateway forces every client to negotiate a common response shape, which tends toward a lowest common denominator or a bloated payload with fields only some clients need
- A BFF adds an extra deployable per client type — more services to run, version and keep available
Choosing between a shared API gateway and one BFF per client
- API Gateway
- One entry point, one response shape, for every client
- Owned by a central platform team
- Simple to run, but the contract must satisfy every client at once
- Backend-for-Frontend
- One backend per client experience (web, iOS, Android)
- Owned by the team that owns the matching client
- More services to run, but each shape fits its one client exactly
Command
API gateway: web ─┐
mobile ─┼─→ [one gateway, one contract] → services
partner ┘
BFF: web ────→ [web-bff] ─┐
mobile ──→ [mobile-bff] ─┼─→ services
partner ─→ [partner-bff]┘An API gateway is one shared entry point and contract for every client; a BFF is one backend per client experience, shaped around what that one client actually needs. Reach for a BFF only when clients genuinely diverge — otherwise it is extra services with nothing to show for them.