"BFF is a topology — a server-side layer owned by the FE team that aggregates microservices and returns a UI-shaped response. REST and GraphQL are contracts — how the browser talks to that layer. A GraphQL server that aggregates services for one UI IS a BFF with a GraphQL interface. They're not alternatives. I'd start with a REST BFF (stable shapes, GET caching, zero learning curve), switch to a GraphQL contract when field-selection proliferation kicks in, and move to Federation when I have BFF sprawl."
| Pattern | What it is | BFF? |
|---|---|---|
| REST BFF | HTTP endpoints per screen, FE-owned | ✓ Yes |
| GraphQL BFF | GraphQL schema, FE-owned, aggregates services | ✓ Yes |
| Federation | Domain subgraphs → shared supergraph, shared by all clients | Not per-client |
Common production stack: shared Gateway (global concerns) → per-client BFF → microservices.
| REST | GraphQL | |
|---|---|---|
| Field selection | Server-fixed | Client-per-query |
| HTTP caching | Native (GET/CDN) | Harder (POST) |
| New data need | New endpoint | Add to query |
| N+1 risk | Endpoint-level | Resolver (DataLoader) |
| Debugging | curl URL | GraphiQL/Sandbox |
| Learning curve | Low | Higher |
Five BFF jobs (aggregate / shape / orchestrate / secure / degrade) are identical either way.
Next.js Route Handlers + Server Components aggregate services, hold secrets, and ship UI-shaped data. That's the BFF role. No separate tier needed unless you have a second client (native) that doesn't run through that server.
RSC takes it furthest: data layer + view in one place, zero aggregation JS to the browser.
Domain teams own subgraphs composed into one supergraph. Each client queries what it needs — no per-client aggregation. SoundCloud migration: ~86% less compute, ~45% better latency. Trade-off: adds a graph platform + governance layer to run.
Don't add Federation until you have the sprawl. Don't merge BFFs into one (one-size-fits-none monolith).
BFF = topology (FE-owned, aggregates microservices, server-side). REST/GraphQL = contract. · Start REST BFF: stable shapes, GET caching, fast ship. · Switch to GraphQL BFF: field-proliferation pain, relational data. · Federation: BFF sprawl, domain subgraph ownership. · SSR/RSC server = your BFF. · Token-handler: real token in BFF, HttpOnly cookie to browser (L18). · Keep it thin. · SoundCloud: BFF → Federation (86% compute ↓, 45% latency ↓).