Skip to content
StackDecode
System Design
3. Client-Server ArchitectureAnimated

Backend for Frontend (BFF)

A dedicated backend for each type of client.

The idea

A web BFF and a mobile BFF each shape data for their client, calling shared services behind.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

Web appMobile appWeb BFFMobile BFFUsersOrdersCatalog
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Each client type gets its own backend-for-frontend.

step:
1/4
at:
Web app
1/9

The green dot is a request moving through the system.

Step by step

  1. 1Each client calls its own BFF
  2. 2The BFF calls several services
  3. 3It combines and trims the data
  4. 4It returns a response sized for that client

Where it is used

Apps with very different clients.

Watch out for

Duplicated logic across BFFs.

Related