“Why Backend for Frontend Is Key to Your Microservices Journey” notes

Steve Mu
Sep 13, 2022


each user experience has a BFF
web has a BFF, iPad/iPhone apps have a BFF
BFF helps us create code with the same models in client and in BFF. it acts as a translation layer.
BFF get data from various microservices and put together data models directly for UI for consume

OPTIONS is used for pre-flight request to see if a server accept certain method, headers or origins.

BFF layer normalize error-handling. Different down-stream services may provide error in different format, they could be http code with json, or http code with xml, or just html file. They normalize all of these into 206, 400, 401, 404 etc. They use custom headers to add error details. 500 is only for BFF errors.

Buffer against change: build APIs with stub data until real data is ready.

BFF could have general-use or view-specific APIs.