Banking

Balance accuracy, transfer state durability, and audit requirements are structural requirements that client-side state works against.

Try the live demo →

The client-side state model

Banking SPAs typically load account balances into client state on page load and update them optimistically on transfer submission. The problems are structural:

  • Balance staleness. The client holds a balance snapshot. Between load and display, another transaction may have changed the balance. The user sees a stale number. For spending decisions, this matters.
  • Double submission. Network failures on transfer submission can leave the client uncertain whether the transfer occurred. Retry logic on the client can produce duplicate transfers if not carefully designed with idempotency keys.
  • Audit surface. Client-side state transitions are unlogged. The audit trail lives in the backend but reconstructing it from client events requires the backend to trust client-reported sequences.

What moves to the server under SAUI

  • Account balance: computed from the event log on every projection request
  • Transfer validation: funds availability checked at gateway before event append
  • Idempotency: transfer actions carry a client-generated idempotency key; the gateway deduplicates
  • Audit trail: every state transition is an event; the log is the audit trail by construction

What stays on the client

  • Transfer form input state (cleared on successful submission)
  • Account list expand/collapse UI state
  • Date picker interaction state

Security properties gained

Balance display is always current: computed from the event log on request, not from a cached client value. Transfer validation occurs at the gateway before any event is appended; no optimistic balance update to reconcile. The audit trail is a structural consequence of the append-only log, not a separate logging system that might be bypassed.

Regulatory fit

The append-only event log is a natural fit for financial audit requirements. Every state transition is timestamped, session-tagged, and immutable by construction. Regulatory queries such as "show all transfers by this account in this period" are projections over the event log; no separate audit infrastructure required.

Next: Healthcare booking