xenia

Design

How xenia is built: what it promises, and the model behind it. For using it, see the configuration and running guides.

Core Design Principles

Architecture

Data Plane (C + libuv)

Responsible for:

Properties:

Control Plane (QuickJS)

Responsible for:

Properties:

State Model

All runtime configuration is represented as:

immutable, versioned route graph snapshots

Each snapshot contains:

Snapshots are never modified after creation.

State Transitions

  1. Current ACTIVE snapshot is read-only
  2. Control plane produces a batch of commands
  3. A new snapshot is constructed from the active state
  4. Commands are applied during construction
  5. New snapshot is validated
  6. Atomic pointer swap publishes the new state
  7. Old snapshot is retired asynchronously

This ensures zero downtime updates and consistent request behavior.

Memory Model

Xenia uses arena-based allocation for snapshot construction:

This avoids fragmentation and simplifies memory ownership.

Concurrency Model

Control Protocol

All configuration changes are expressed as typed commands:

Commands are validated in C before being applied to a new snapshot.

Goals

Non-Goals