← Back to microservices patterns mapdesign
🏗️
Microservices Pattern
Backends for Frontends (BFF)
Create a tailored backend/API layer per client type such as web, mobile, or TV.
Detailed Description
Different clients often need different payload shapes, latency budgets, and workflows.
A BFF keeps client-specific aggregation out of core domain services.
Visual Diagram
Per-Client Backends
📱 Mobile → [BFF-Mobile] → lean payload
🌐 Web → [BFF-Web] → rich payload
📺 TV → [BFF-TV] → media-optimized
↓ all call same microservices
[UserSvc][OrderSvc][ProductSvc]Tradeoffs
Pros
Optimized per client, less frontend orchestration
Cons
Possible duplication across BFFs
Examples: Netflix, SoundCloud BFF architecture