Prompt

Can you show me a Backend for Frontend architecture example?

Technology · Developer Tools / Developer tools2 observationsLast seen Jul 15, 2026

Latest observation

Jul 15, 2026 · Gemini

Understanding the BFF Architecture with an Example In a traditional microservices architecture, multiple client applications (like a Web App, an iOS App, and an Android App) might try to communicate directly with various downstream microservices (e.g., User Service, Product Catalog Service, Order Service). This approach leads to several problems: Over-fetching or under-fetching: Mobile apps might only need a few fields, whereas the desktop app needs the full data payload. Chatty clients: Clients must make multiple API calls to stitch together the data they need, which degrades mobile performance over cellular networks. Security & Protocol mismatches: Downstream services might use gRPC or AMQP, which are not web-friendly. The Backend for Frontend (BFF) pattern solves this by introducing a dedicated, lightweight backend layer for each specific user interface. Example Scenario: E-Commerce Application Let's look at how an e-commerce platform uses BFFs to cater to two distinct frontends: a Desktop Web App and a Mobile App.

  1. The Client Apps (Frontend Layer) Desktop Web App: Runs on a large screen with high-speed internet. It displays rich dashboards, detailed product descriptions, and multiple sidebars. Mobile App: Runs on a smaller screen, often on slower or unstable cellular networks. It requires highly optimized payloads, minimal data consumption, and simple lists.
  2. The BFF Layer Instead of having a single API gateway for both, we build two separate BFF services: Web BFF (Node.js / Express or Next.js): Formats data to fit a large desktop grid. Combines reviews, recommended products, and item details into a single large JSON response. Uses standard cookies and web-specific session management. Mobile BFF (Node.js or Go): Strips out unnecessary fields (like high-resolution image URLs or long text reviews) to minimize payload size. Aggregates only essential product data, price, and stock status. Implements mobile-specific authentication (like OAuth2 token exchange and push notification registration). Handles compression aggressively to support low-bandwidth connections.
  3. Downstream Microservices (Shared Backend Layer) Both BFFs communicate with the same core, domain-driven microservices over high-speed internal networks (often using fast protocols like gRPC): Catalog Service: Manages product details and inventory. Ordering Service: Processes checkouts. User Profile Service: Manages customer accounts. Key Benefits of This Architecture Decoupling: The mobile team can update the Mobile BFF API contract to release a new app feature without needing coordinates or changes from the desktop web team. Optimized Performance: Mobile devices make one API call to the Mobile BFF, which efficiently aggregates data from downstream microservices internally. Separation of Concerns: The core microservices can focus purely on business logic (like processing an order) without worrying about how the data is formatted or displayed on a screen.

Observation history

See 1 earlier observation

Create a free Obsurfable account to unlock historical responses, model comparisons, and deeper brand intelligence.

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 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, and Meta AI.