AlgoMaster Logo

Backend for Frontend (BFF)

Last Updated: May 26, 2026

Ashish

Ashish Pratap Singh

Medium Priority
8 min read

An API gateway gives clients a controlled entry point. A Backend for Frontend goes one step further: it gives each client experience an API shaped for that experience.

A web app, mobile app, partner integration, and admin console may use the same product domain but need different payloads, caching behavior, latency budgets, permissions, and release cycles.

The Backend for Frontend (BFF) pattern creates a small backend for one client family. It receives client requests, calls backend services, composes the result, and returns a response that fits that client.

The goal is to keep client-specific behavior close to the client without polluting core services or turning a shared gateway into a pile of client-specific branches.

The Problem: One API Shape Does Not Fit Every Client

Consider a product detail page used by three clients.

ClientNeeds
Web appFull description, large images, reviews, related products, SEO metadata
Mobile appCompact description, small images, rating summary, stock status
Partner APIProduct ID, SKU, price, availability, bulk sync metadata

Those clients are asking about the same product, but they are not asking for the same representation.

Different Interaction Patterns

The mobile app is sensitive to payload size and unreliable networks. The web app may care about server rendering, SEO metadata, and rich interaction. The partner API may prefer stable bulk-oriented contracts over UI-friendly responses.

Different Release Cycles

ClientTypical Release Constraint
Web appCan deploy many times per day
iOS appApp Store review and slow client upgrade curve
Android appFaster than iOS in many teams, still client-version constrained
Partner APIBreaking changes may require months of notice
Admin consoleOperational workflows may need fast iteration and richer permissions

A shared API must protect the slowest-moving consumer. BFFs let each client contract evolve at the pace of that client.

Shared Gateway Drift

When every client-specific concern goes into one gateway, the gateway stops being a clean edge layer.

Changes for one client start creating risk for every other client. Ownership also gets murky: the platform team owns the gateway, but product teams keep adding product-specific behavior to it.

The Solution: Backend for Frontend

Premium Content

This content is for premium members only.