Patterns
35 items
35 items
Client-specific API layers for different frontends
Backend for Frontend (BFF) creates dedicated backend services for each client type (web, mobile, smart TV). Instead of one generic API serving all clients, each BFF is tailored to its client's specific needs - aggregating data, transforming responses, and handling client-specific logic. This enables optimal API design per platform, independent deployment, and better separation of concerns. Netflix uses BFFs for different devices, Spotify has mobile and web BFFs. The pattern shines when clients have vastly different needs.
Mobile needs less data (bandwidth), web can handle more. BFF returns exactly what each client needs, no over-fetching or under-fetching.
Mobile team owns mobile BFF, can iterate independently. Web changes don't affect mobile and vice versa. Faster development velocity.
Mobile offline sync, web real-time updates, TV simplified navigation - each BFF handles platform-specific requirements without polluting core services.
Why separate BFFs?
Mobile BFF: - Minimal payload (bandwidth costs) - Aggregated endpoints (reduce round trips) - Offline sync support - Push notification handling
Web BFF: - Rich data for powerful UI - Real-time WebSocket support - SEO considerations - Server-side rendering support
TV BFF: - Simplified navigation data - Large media URLs - Voice command support - Low-power device optimization