One is an edge you share across every client. The other is an edge you build per client. Knowing which problem you actually have saves you a year of arguing about payload shapes

By The Coding Gopher

Published: 2026-11-19

URL: https://thecodinggopher.substack.com/p/backend-for-frontend-vs-generic-api


You ship a REST API, a web app consumes it, everything is fine.

Then you add a mobile app.

The mobile team wants fewer round trips because the network is slow and unreliable. The web team wants the full object graph because they’re rendering a dense dashboard. Somebody adds ?include=orders,shipments,customer to keep both happy. Then the smart TV app arrives needing a fourth shape entirely, and now your “generic” endpoint has eleven optional query parameters, a fields allowlist, and a comment that reads:

// do not change this, the iOS app depends on it

That’s the pressure Backend for Frontend exists to relieve. It’s usually framed as an alternative to an API gateway, which is a category error — they solve overlapping problems at different granularities, and most mature systems run both.

Backend For Front End- Architectural Pattern | by Dipak Kr das | Medium

\Traditional architecture uses a single, general-purpose backend API for all client interfaces, while a Backend for Frontend (BFF) architecture provides a dedicated backend service tailored to each specific frontend like mobile, web, or TV.\


The distinction in one line

An API gateway is one shared edge for all clients. A BFF is a dedicated backend serving exactly one client experience.

Backend For Frontend (BFF) Pattern

\A Backend for Frontend (BFF) isa design pattern that creates a dedicated server-side service for each distinct type of client interface, such as a web app, mobile app, or smart TV. Instead of using a single, general-purpose API for every device, a BFF sits between your frontend and core backend microservices, tailoring data and logic to fit the specific needs of that single user experience.\

Everything else follows from that.

A gateway is generic on purpose, so it handles what every client needs identically: auth, rate limiting, TLS, routing.

A BFF is specific on purpose, so it handles what differs per client: which fields that screen needs, how many calls to aggregate, what shape the response takes.

API Gateway Pattern. In this article, we are going to talk… | by Mehmet Ozkaya | Design Microservices Architecture with Patterns & Principles | Medium

\AnAPI Gatewayis a management tool that sits between a client and a collection of backend services, acting as asingle entry pointfor all incoming requests. Instead of having clients call dozens of individual microservices directly, the gatewayintercepts the traffic and handles essential cross-cutting concerns like routing requests to the correct destination, authenticating users to ensure secure access, and rate limiting to prevent servers from being overwhelmed by too many requests at once. It also provides functionality forload balancingto distribute traffic evenly across servers,data transformationto convert protocol formats (like XML to JSON) on the fly, andcentralized logging and monitoringto track the health and performance of the entire application ecosystem from one location.\

Join a community of senior engineers. Subscribe and get FREE access to System Design deep dives.


Learn System Design, Visually (Module 1 Free)

System Design, Visually Explained: animated video course by The Coding Gopher

Want to understand systems like this well enough to design them yourself?
My animated course System Design, Visually Explained builds every concept as a clean, step-by-step diagram, from the fundamentals to real interview designs. It grew out of my YouTube explainers, which have millions of views.
Module 1 is free. No card needed.
Want everything? All-Access Lifetime includes all 6 live courses (System Design, AI Engineering, Backend Development, Cloud Development, System Design: Case Studies and Data Structures & Algorithms), the 10 on the way (Distributed Systems, How Computers Really Work, Database Internals and more), the full System Design Visual Guide and every course after that, for one payment.
💡 Many engineers expense this through their team's learning budget.

Building a product for developers? Put it in front of thousands of engineers who read this newsletter and watch The Coding Gopher on YouTube. Newsletter and video sponsorships are open.

Generic API Gateway