> For the complete documentation index, see [llms.txt](https://docs.7ft10.com/flow-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.7ft10.com/flow-system/agile-software-architecture-c4-model/patterns/back-end-for-front-end-bff.md).

# Back-end for Front-end (BFF)

{% embed url="<https://www.freecodecamp.org/news/an-introduction-to-software-architecture-patterns/>" %}

One problem that comes up when implementing microservices is that the communication with front-end apps gets more complex. Now we have many servers responsible for different things, which means front-end apps would need to keep track of that info to know who to make requests to.

Normally this problem gets solved by implementing an intermediary layer between the front-end apps and the microservices. This layer will receive all the front-end requests, redirect them to the corresponding microservice, receive the microservice response, and then redirect the response to the corresponding front-end app.

The benefit of the BFF pattern is that we get the benefits of the microservices architecture, without over complicating the communication with front-end apps.

<figure><img src="https://1491389417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZKVth8lQoa81KxznCuDw%2Fuploads%2FHFSgsZf4Q9n3vkcEwonI%2Fimage.png?alt=media&amp;token=e4c49649-477d-4dbd-8488-e25cb3b91f04" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1491389417-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZKVth8lQoa81KxznCuDw%2Fuploads%2FiCvQ02lUSgYO3OhEHQJA%2Fimage.png?alt=media&amp;token=c5c80f8b-eed5-4262-8b72-08caa92f1ec3" alt=""><figcaption></figcaption></figure>
