Concept

Boundary Roles: ISB, IFB, ESB, EFB

The four-buffer topology as logical roles

Audience: Architects, implementers. Use: Understand the four mandatory boundary roles and their invariants.

Overview

The four-buffer model is the architectural heart of BSFG. It defines four logical boundary roles: ISB, IFB, ESB, and EFB.

These roles are not services or concrete components — they are principles that describe what each part of the boundary does, independent of how it is implemented. A BSFG node may implement one or more of these roles using any conforming zone-local durability substrate.

Role Definitions

Each boundary role has a specific responsibility in the ingress-to-egress path. The table below maps each role to its direction, responsibility, and durability characteristics:

Role Direction Responsibility Durability Type
ISB
(Ingress Store) Inbound: External Zone Non-blocking durable write at external perimeter Write-Ahead Log (fsync or replication)
IFB
(Ingress Forward) Inbound: Internal Zone Idempotent deduplication via putIfAbsent Durable forward buffer (conditional insert)
ESB
(Egress Store) Outbound: Internal Zone Non-blocking durable write at internal perimeter Write-Ahead Log (fsync or replication)
EFB
(Egress Forward) Outbound: External Zone Idempotent deduplication via putIfAbsent Durable forward buffer (conditional insert)

Ingress vs Egress Flows

The boundary operates in two directions. Here is a simplified flow showing how the four roles work together:

INGRESS FLOW (Inbound to Internal Zone):
  External Zone
       ↓
      ISB (store)
       ↓
    Handoff (async replay)
       ↓
      IFB (forward)
       ↓
  Internal Zone

EGRESS FLOW (Outbound to External Zone):
  Internal Zone
       ↓
      ESB (store)
       ↓
    Handoff (async replay)
       ↓
      EFB (forward)
       ↓
  External Zone

              ISB ←→ IFB    (Gate controls flow)
              ESB ←→ EFB
    

Three-Layer Ontology

To avoid confusion between roles and implementations, BSFG distinguishes three layers:

For one reference implementation of these roles, see NATS/JetStream Reference.

Key Invariants

The four-buffer topology enforces several architectural invariants:

Terminology

Gate

A logical circuit breaker. When open (normal operation), synchronous paths work. When closed (network partition), producers and consumers continue via local buffers; the handoff freezes.

Cursor / Frontier

The position in the store buffer up to which facts have been durably confirmed at the forward buffer. Also called highest_contiguous_committed_offset.

Handoff

The asynchronous transfer of facts from store buffer to forward buffer. Driven by cursor advancement and replay.