Backend for Frontend (BFF) is an architecture pattern where each kind of client, for example the website and the mobile app, gets its own thin server layer. That layer calls the underlying services, combines the results and returns exactly the data its client needs.
Why it matters
A single general-purpose API tends to either over-fetch for mobile or force the browser to make many round trips. A BFF moves that orchestration to the server, where network links are fast, and keeps client-specific logic out of shared services. It can also hold secrets and tokens so they never reach the browser. The cost is another deployable component to run and monitor, and another place where an outage can occur.
Example
A product page needs data from three services:
GET /bff/product/42
-> catalog-service /items/42
-> pricing-service /prices/42
-> reviews-service /summary/42
The BFF merges the three responses into one JSON payload. If reviews are down, it can return the page without them instead of failing, a form of graceful degradation.
Common mistakes
- Letting the BFF grow business rules that belong in the services behind it.
- Sharing one BFF across very different clients, which recreates the general API problem.
- Skipping timeouts on the fan-out calls, so one slow service stalls the whole page.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.