Summary

Backend for Frontend is a backend layer tailored to a specific client experience, such as web, mobile, or admin UI.

Interview Points

  • BFF reduces frontend complexity by aggregating and shaping data.
  • Different clients can have different BFFs.
  • Useful for auth, session handling, orchestration, and response shaping.
  • Avoid turning the BFF into a giant business-logic monolith.
  • BFF is especially useful when many backend services feed one UI.

2-3 Minute Interview Script

“The BFF pattern creates a backend specifically for a frontend client. Instead of the browser calling many microservices directly, the BFF aggregates data, handles client-specific shaping, and provides a simpler API to the UI.

This is useful when web and mobile need different payloads, auth flows, or orchestration. It can reduce over-fetching, hide internal service topology, and keep tokens or sessions easier to manage.

The tradeoff is ownership and duplication. If multiple BFFs repeat business logic, consistency suffers. I would keep domain logic in backend services and use the BFF for composition and client adaptation.

Interview answer: a BFF is a client-specific API layer that improves frontend ergonomics while preserving clean domain boundaries.”

Follow-Ups

  • How is BFF different from API gateway?
  • What logic belongs in a BFF?