Distributed systems

SAUI scales to distributed backends. "Server-authoritative" means authoritative per service domain, not a single global database.

Try the live demo →

The misconception

A common objection to SAUI in distributed system contexts is that "centralised state" is a scaling bottleneck. This conflates two different things: the number of state stores and the question of who owns state.

SAUI does not require a single database. It requires that each service domain owns its state authoritatively. The frontend does not hold state. That constraint is compatible with a large distributed backend.

The BFF pattern under SAUI

Frontend (stateless display)
    |
BFF - Backend for Frontend
    (owns session state, aggregates projections)
    |
Order Service | Inventory Service | Payment Service | User Service
(each owns its domain state authoritatively)

The frontend talks to one service: the BFF. The BFF aggregates projections from domain services and presents a unified projection to the frontend. Distribution complexity lives behind the BFF; the frontend is unaware of it.

Actions submitted by the frontend go to the BFF. The BFF routes them to the appropriate domain service. The domain service validates and applies the action against its own authoritative state. The BFF collects the result and returns an updated projection.

What moves where

  • Session and ephemeral state: BFF owns this
  • Order state: Order Service owns this
  • Inventory state: Inventory Service owns this
  • Payment state: Payment Service owns this
  • Projection aggregation: BFF composes these into a frontend-appropriate read model

Each service state is authoritative within its domain. No service reaches into another service state directly. The projection is computed at the BFF by querying each service read API.

What the frontend gains

The frontend is entirely decoupled from the distribution topology. Adding a new microservice, splitting an existing one, or changing inter-service protocols does not affect the frontend. The projection contract is the interface. As long as the BFF honours it, the frontend is unaffected.

Next: Micro frontends