Backend For Frontend

1. What exactly is Backend For Frontend?

A mobile app screen needs data from three separate backend services to fully render: one for status, one for details, one for a calculated estimate. The app calls all three directly from the phone.

On a slow or unreliable mobile connection, each of those three round trips adds its own separate latency, so the screen takes far longer to load than any one call alone would. And if even one call fails, the screen ends up only partly loaded.

Every extra round trip from a slow client is latency and a chance to fail, multiplied by how many the screen needs. That's exactly what a Backend for Frontend fixes.

2. How would you fix it in .NET?

A Backend for Frontend takes over the fan-out: add one endpoint, a BFF, sitting in front of the three backend services. That endpoint makes its own three calls over the fast internal network, not the client's slow one, and combines the three results into a single response it returns to the client.

Use: ASP.NET Core Minimal API, Task.WhenAll

Move the fan-out to the server side, where the network is fast, and give the client one call to make.

3. How can you visualize it in everyday terms?

One trip to the grocery store covers milk, bread, and eggs in a single outing. Three separate trips for the same three items costs three times the driving, three times the parking, three chances to find the store closed.

A single trip with one list does the same job with a fraction of the travel.

One grocery trip: gather everything needed in a single outing instead of a separate trip for each item.