Architecture Overview
Detent separates three jobs that most configuration systems blur together: deciding what the configuration is, distributing it, and serving it to code. Each runs at a different speed and fails differently, and keeping them apart is what lets a read stay a few hundred nanoseconds while distribution can be down for an hour.
The Big Picture
Section titled “The Big Picture”This is the managed profile, the topology Detent’s production contract targets.
The Actors
Section titled “The Actors”| Actor | What it does | Runs on | Binary |
|---|---|---|---|
| Producer | Writes knob changes as namespaced transactions | Anywhere that reaches the authority | Your service, or curl |
| Authority | Orders, stores and serves the source of truth | Three machines, one voter each | detent-authority --authority authority.json |
| Relay | Optional fan-out: one upstream subscription per bundle, many agents | Between the authority and agent hosts | detent-relay |
| Agent | Receives snapshots and deltas, publishes immutable generations | Every application host | detent-agent --managed managed.json |
| Reader | Maps the selected generation and reads in memory | Every application host | Your app (detent::Reader), detent get |
Voters, relays and agents are all daemons; “daemon” names no role. Each actor has its own page: Authority, Relay, Agent and Delivery and Local Images for the agent’s generations, and Read Path for the reader. Detent’s actors in the repository is the full reference: endpoints, files, build options, default directories and restart behavior for every actor.
Three Planes
Section titled “Three Planes”Data Plane: Reads
Section titled “Data Plane: Reads”The read path runs inside your process and, once warm, does nothing but memory access: validate the name, pin the installed view, load the change sequence, walk the mapped generation, and evaluate. No network, syscall, lock or allocation. See Read Path.
Update Plane: the Generation Switch
Section titled “Update Plane: the Generation Switch”The reader starts no thread. When the agent publishes a generation, the lookup that sees the moved change sequence attaches it and publishes a new view; every other thread keeps reading the installed one. A failed attach keeps the installed view, so failures never reach readers. See Update Path.
Control Plane: Distribution
Section titled “Control Plane: Distribution”The authority accepts transactions and replicates them durably across its voters; relays and agents carry the committed state to every host as snapshots and deltas. See Authority and Relay.
Design Principles
Section titled “Design Principles”- Reads never wait on distribution. A distribution failure degrades freshness, never availability.
- Immutable generations, atomic switches. Readers see one complete, validated configuration or the previous one, never a mixture.
- A fallback on every read. Every lookup returns the caller’s fallback on
any error, and
lookupreports the status, so a missing knob is visible to code that asks and never crashes code that doesn’t. - Whole-definition replacement. A knob is an atomic unit; there’s no field-level merge to reason about.
- Everything is bounded. Request bodies, snapshot sizes, queues, history, retained memory and disk are all limited before allocation.
- Measured, not asserted. Performance claims come with a reproducible benchmark and its caveats.
Where to Read More
Section titled “Where to Read More”- Read Path and Update Path: the reader.
- Agent: host-local reads.
- Durable Authority: transactions and durable consensus.
- Relay: optional durable fan-out.
- Delivery and Local Images: managed distribution and immutable generations.
- Dependencies: the libraries Detent is built from.
- Design Documents: the full engineering record in the repository.