Prompt

What's the difference between an API gateway and a Backend for Frontend?

Technology / Developer Tools3 observationsLast seen Aug 27, 2026

Latest observation

Aug 27, 2026OpenAI APIWeb search: off

An API Gateway and a Backend for Frontend (BFF) both sit between clients and backend services, but they solve different problems.

API Gateway

A gateway is a generic entry point for many clients and many backend services.

Main purpose

  • Route requests to the right service
  • Handle cross-cutting concerns:
    • authentication/authorization
    • rate limiting
    • logging/metrics
    • request/response transformation
    • SSL termination
  • Hide internal service topology

Characteristics

  • Usually shared by multiple clients: web, mobile, partner apps, etc.
  • Usually organization/platform-oriented
  • Not usually tailored heavily to one specific UI
  • Can be “thin” and mostly pass-through

Example

/users/123 gets routed to the User Service, /orders/456 to the Order Service.


Backend for Frontend (BFF)

A BFF is a backend built for a specific frontend or client type.

Main purpose

  • Provide exactly the data and shape a particular UI needs
  • Reduce chatty calls from the frontend
  • Aggregate data from multiple downstream services
  • Encapsulate frontend-specific logic

Characteristics

  • Usually one BFF per frontend:
    • web BFF
    • mobile BFF
    • admin dashboard BFF
  • Optimized for a particular user experience
  • Often does orchestration and composition
  • May expose endpoints that don’t map cleanly to internal services

Example

A mobile app may want:

  • user profile
  • recent orders
  • notifications all in one response from /home-screen

The BFF combines data from multiple services and returns a mobile-friendly payload.


Key difference in one sentence

  • API Gateway = shared infrastructure for routing and policy enforcement
  • BFF = client-specific backend optimized for a particular frontend

Comparison

AspectAPI GatewayBFF
AudienceMultiple clientsOne specific frontend/client type
FocusInfrastructure and policiesUI-specific data and orchestration
ScopeBroad, genericNarrow, tailored
Data shapingMinimal to moderateHeavy, frontend-oriented
Number of instancesUsually one per platform/edgeOften one per frontend
Typical ownershipPlatform/backend teamFrontend/product team or joint

Can they be used together?

Yes. Common setup:

Client → BFF → API Gateway → Microservices

Or sometimes:

Client → API Gateway → BFF → Microservices

Though in many architectures, the BFF is the “edge” backend and the gateway may sit behind it or be folded into it depending on the team and scale.


Rule of thumb

  • Use an API Gateway when you need shared ingress, security, routing, and operational control.
  • Use a BFF when a frontend needs a custom backend tailored to its UX and data needs.

If you want, I can also give you a real-world architecture diagram or when to choose one vs the other.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (3 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.