What is Backend for Frontend (BFF)?
A pattern where each client type gets its own dedicated backend layer that aggregates and shapes data for that UI.
Definition
The BFF pattern, popularized at SoundCloud by Phil Calçado, gives each frontend—web app, iOS, Android, smart TV—its own thin server that composes downstream services into responses shaped exactly for that interface. This avoids the one-size-fits-none general API: mobile gets compact payloads and fewer round trips; web gets session handling and can keep OAuth tokens server-side in httpOnly cookies rather than in browser storage. Each BFF is owned by the frontend team it serves, aligning change cadence with the UI. Next.js API routes and server components often function as de facto BFFs; GraphQL sometimes substitutes by letting clients shape queries themselves.

