BFF

  • aka BFF
    • Separate backend services for different types of clients, such as desktop and mobile.
    • Single backend service doesn’t need to handle the conflicting requirements of various client types.
  • Steps:
    • Call the relevant microservices APIs and obtain the needed data
    • Format the data based on the frontend representation
    • Send the formatted data to the frontend

Advantages

  • Separation of concerns
    • Frontend requirements will be separated from the backend concerns. This is easier for maintenance.
  • Easier to maintain APIs
    • The client will know less about your APIs structure, which will make it more resilient to changes in those APIs.
  • Better error handling in the frontend
    • Server errors are meaningless to the frontend user most of the time.
    • Instead of directly returning the error server sends, the BFF can map out errors that need to be shown to the user.
    • This will improve the user experience.
  • Multiple device types can call the backend in parallel
    • While the browser is making a request to the browser BFF, the mobile devices can do the same. It will help obtain responses from the services faster.
  • Better security
    • Certain sensitive information can be hidden, and unnecessary data to the frontend can be omitted when sending back a response to the frontend.
    • The abstraction will make it harder for attackers to target the application.
  • Shared team ownership of components
    • Frontend teams can owns both their client application and its underlying resource consumption layer

BFF