System topology & invariants

Five planes.
One storage fabric.

Strata eliminates the external SQL databases, static load-balancer files, and disconnected telemetry silos between source, deployment, traffic, and observability. Below are the exact wire paths, durability boundaries, and failure modes.

0 DBs Guardian & LB-Edge require no SQL DB
5m / 30m CAS task claim lease & stale timeout
150,000 Scoped AWS + GCP federation targets
2s LB-Edge proxy snapshot reconcile loop

Control & data paths

System Topology

Coordination flows through routers and CAS queues; steady-state file reads bypass the router directly to HRW-selected Pebble storage nodes, while deployment workers pull work with zero inbound deploy ports.

TRUST BOUNDARY · TLSX SPIFFE MTLS (STRATA_TLS_*) + COMPILED ACCESS POLICY (PARTITIONS · LOGS · TRACES · SQL · MONOFS) AUTHORING Dev / CI / CLI monofs-client (FUSE / headless) guardianctl · forge · NutsDB 05 · MONOFS STORAGE & SOURCE FABRIC monofs-router :9090 Control · UI :8080 · SQL guardian/ & guardian-system/ monofs-server :9000 HRW shards · Pebble DB Parquet + Bluge logengine monofs-fetcher :9200 Packager ChaCha20 archives O(1) S3 / GCS / MinIO reads Git sync & PR rollback Fabric Services Raft KVS (CAS + watch) Zoekt :9100 · OCI :5000 Bazel :9092 · sqlagregator 04 · GUARDIAN CONTROL PLANE guardiand :18090 Intent + Asset DAG Compiler Queues tasks → /.queues/<pusher>/ Observed Collector (:19090 / :19091) Immutable .archive/ + HMAC webhooks Zero DB · zero inbound pusher port EXECUTION · CAS LEASE PULL Native Pushers • GCP (OpenTofu + Asset Inv) • AWS (CDK + CloudFormation) • On-prem K8s · Docker · Local 5m claim lease · DIFF→CHECK→APPLY Deploys workloads + k8s-top 02 · LB-EDGE TRAFFIC Registry :15051 + Proxy k8s-agent watches Endpoints 2s sync · 3-strike breaker · drain Prometheus :19090/metrics 03 · DOCTOR OBSERVABILITY Ingest :4317/:4318 · Query :18080 Pre-WAL HMAC + Luhn PCI funnel Per-signal fsync WAL (429 cap) PromQL · LogQL · TraceQL · SQL Sentinel :18081 · Rules leader lease 150k-target federation (500-target shards) 01 · AGENT & NIGHTWATCH ASSISTANCE PLANE FastAPI :8090 · React :3000 · Nightwatch :8091 Otto (SRE tools + confirm=true gate) · Steve (MonoFS overlay diffs, zero infra mutate) Nightwatch: 30s Sentinel poll · hash-chained SQLite ledger · escalation < 0.5 confidence EXTERNAL STORAGE & SQL S3 · GCS · ClickHouse · BigQuery · Omni sqlagregator two-phase pushdowns Packager O(1) byte-range archives (PKGRv2) direct HRW read (:9000) push bundles (CAS)
Every plane shares MonoFS namespaces and tlsx SPIFFE identities; Guardian pushers hold no open deployment server port. Source: strata/docs · monofs/docs · guardian/docs · doctor/docs

Design decisions

Six architectural bets
that define the stack.

Bet 01 · Guardian + MonoFS + KVS

Filesystem-as-database & pull-based CAS leases

Guardian runs no Postgres, etcd, or inbound worker deployment channel. Partitions, intents, runtime state, and queues are versioned CAS files in MonoFS backed by embedded Raft KVS.

  • Reconciler compiles intent joins and asset dependsOn DAGs, resolving ${intent.X.outputs.KEY}.
  • Tasks land in /.queues/<pusher>/; pushers CAS-create .claims/<taskID>.json with a 5-minute lease (30m stale cutoff).
  • DESTROY executes in reverse dependency order; observed intents stay strictly read-only via :19090/:19091.
Bet 02 · MonoFS + Packager

Client-side HRW sharding & headless writable overlays

Hot steady-state reads never hop through the router. monofs-client fetches topology once, builds a local weighted Rendezvous ring, and hashes paths directly to monofs-server:9000.

  • Local edits land in a per-session NutsDB overlay; --headless serves the identical workspace over a Unix socket without /dev/fuse.
  • Cold content lives in Packager Indexed-Tail archives (ChaCha20-Poly1305 + zstd), retrieving any file in 2–3 HTTP byte-range requests.
  • PathIndex deduplicates directory prefixes (100K files in ~1.2 MB vs ~6.2 MB flat map).
Bet 03 · Doctor

One-way pre-WAL privacy funnel & unified query plane

Doctor owns no custom segment format — it writes Parquet + Bluge chunks into MonoFS logengine while guaranteeing raw secrets and unmasked PII never hit disk.

  • Privacy runs during OTLP flattening before WAL append: secret keys/bearer/JWTs become [REDACTED]; identity/PCI fields become HMAC tok_<16 hex>.
  • Independent per-signal fsync WAL buffers return 429 / ResourceExhausted cleanly on backpressure.
  • One query service serves native JSON, Prometheus, Loki, Tempo, DuckDB SQL, and leader-leased recording rules (30s CAS lease).
Bet 04 · sqlagregator

Two-phase federated SQL with coverage guarantees

sqlagregator compiles restricted SELECT queries into an AST, binds catalog endpoints, and pushes partial aggregations down to native backend dialects before merging in pure Go.

  • Five emitters: MonoFS DuckDB, ClickHouse (attributes['...']), BigQuery REST, CloudWatch Omni, and Logs Insights (FROM_UNIXTIME).
  • Time-shard pruning skips irrelevant backends; excluding a healthy shard fails closed with coverage_gap unless -allow-partial is set.
  • Router enforces loaded access policy via --sql-require-policy (default true) and user sql scopes.
Bet 05 · Doctor Federation Controller

Scoped multi-account federation for 50k pushers / 150k targets

A dedicated controller builds 500-target SHA-256 catalog shards and 256 AES-256-GCM token shards under a 90s MonoFS leader lease so query nodes never load monolithic catalogs or raw secrets.

  • atomic.Pointer[managerState] guarantees zero-tear hot-swaps; corrupt shards preserve the last-known-good catalog.
  • Lazy token resolution coalesces via singleflight with generation bumps so a stale 401 never overwrites a rotated token.
  • Global 64 / per-query 8 inflight cap + 2-strike per-target circuit breakers; unscoped fleet queries fail fast with HTTP 422.
Bet 06 · LB-Edge

Ephemeral L4 registry with automatic re-registration

LB-Edge discards state persistence altogether. Four compact Go binaries reconstruct routing state from Kubernetes Endpoints informers and LB_BOOTSTRAP.

  • Multi-port Kubernetes Services match the exact Service port backing guardian.intent/external-port so traffic never round-robins across unrelated ports.
  • Proxy polls GET /services every 2s; removed backends stop taking new TCP connections and drain to zero active streams.
  • 3 consecutive dial failures trip the passive breaker until the next healthy snapshot refreshes the pool.

Durability & source of truth

State Ownership Matrix

Every byte in Strata has an explicit home, durability guarantee, and rebuild path.

State Physical Home Engine / Format Durability & Concurrency
File metadata & dir index monofs-server local disk Pebble DB (HRW-sharded) Durable, replicated across primary + async replicas; failover bucket on outage
File & OCI blob content monofs-fetcher / S3 / GCS Packager WORM archives (ChaCha20-Poly1305 + zstd) Content-addressed, immutable, O(1) 2-request HTTP byte-range reads
Uncommitted IDE / Steve edits monofs-client overlay NutsDB local overlay + session socket Local per-session; never hits shared cluster until monofs-session push
Guardian desired state & queues MonoFS guardian/ & guardian-system/ Embedded Raft KVS (hot) + Packager (cfg cold) Optimistic CAS versions, 5m task claim leases, immutable .archive/ logs
Traces, logs & metrics MonoFS logengine Parquet chunks + Bluge index + manifest HRW-sharded across storage nodes; envelope encryption & compaction
Ingest burst buffer doctor-ingest local disk Per-signal WAL (.doctor/*-buffer/) fsync durable across restart until flushed; 429 on overflow
Federation catalog & tokens MonoFS /doctor/v1/federation/ 500-target SHA-256 shards + 256 token shards AES-256-GCM encrypted tokens; atomic.Pointer swap; CAS under 90s leader lease
Agent & Nightwatch ledgers /data/lagent.db & Nightwatch DB SQLite + append-only hash-chained events Durable local volumes; writer chain halts on unacknowledged inserts
L4 routes & active breakers lb-edge / registry / proxy memory In-memory state Intentionally ephemeral; reconstructed via 30s K8s informer resync + bootstrap

Interfaces & protocols

Wire Surfaces & Ports

Component Surface Port / Path Protocol & Auth Contract
MonoFS Router Cluster control, ingest, SQL :9090 / :8080 gRPC + HTTP UI; OIDC / break-glass / pkg/authz + tlsx mTLS
MonoFS Server / Fetcher / Search Shards, archives, Zoekt :9000 / :9200 / :9100 gRPC + SPIFFE URI SAN peer allowlists; OCI v2 :5000; Bazel :9092
Guardian Daemon & Pushers UI/API & observed read APIs :18090 / :19090 / :19091 OIDC + /api/m2m/*; AWS/GCP read APIs require TLS on non-loopback
Doctor Ingest / Query / Rules OTLP, Prom/Loki/Tempo/SQL, Alerts :4317 / :4318 / :18080 / :18081 OTLP gRPC (256 MB cap) + HTTP; OIDC + partition access enforcement
LB-Edge DiscoveryRegistry, sync, metrics :15051 / :18081 / :19090 gRPC registry, HTTP /services snapshot, Prometheus metrics, dynamic TCP ports
Agent & Nightwatch Chat WS/HTTP, React UI, Nightwatch :8090 / :3000 / :8091 PKCE OIDC + device flow; internal bearer tokens; Nightwatch API not public

Operational resilience

Failure Modes & Recovery

Documented degradation paths for every critical plane — verified by unit, chaos, and kill-node soak tests.

Failure Scenario Immediate Blast Radius Built-in Recovery Behavior
MonoFS storage node killed Reads/writes assigned to that HRW shard miss Router assigns failover node + TTL'd file list; delayed rebalance after ~10m; clients re-route seamlessly on return (verified in kill node-c soak)
MonoFS router unavailable New mounts, ingests, publishes, Guardian writes pause Steady-state client reads continue directly via cached local HRW ring; clients re-register on router recovery
Guardian pusher offline / crashed In-flight apply stalls; tasks accumulate in queue .claims/<taskID>.json 5-minute lease expires cleanly; surviving pusher reclaims and resumes up to 30m stale cutoff
Concurrent Guardian write / ListDir race A concurrent write hides a .state entry mid-scan Runtime skips that single intent for the cycle instead of failing the partition; Guardian version misses < 10m return transient Unavailable
Doctor WAL or pipeline saturated Ingest reaches configured memory/segment limits Returns HTTP 429 / gRPC ResourceExhausted backpressure; local fsync WAL replays buffered batches on restart
Remote federation target down / 401 Subset of AWS/GCP targets slow, unreachable, or rotated 401 triggers token invalidate + singleflight retry; 2 consecutive errors open 15s breaker; response returns partial data + X-Doctor-Partial header
KVS quorum lost guardian-system queues and config mutations pause Normal MonoFS file reads and OCI v2 registry writes continue unaffected on healthy storage nodes
Multi-repo workspace push fails mid-way One upstream repo rejects push after earlier repos succeeded Fetcher creates revert commits (never force-pushes) and reports exact per-repository status back to the session
LB-Edge registry restarts empty Proxy receives an empty valid snapshot and drains routes k8s-agent informer resync (30s) re-registers all annotated Endpoints; edge static routes re-seed on process start
Shared ClickHouse legacy fan-out Scanning storage replicas would duplicate shared rows Legacy node fan-out explicitly returns Unimplemented; policy-routed ClickHouse placements route once via MultiResolver
Documented Boundaries & Non-Goals

Explicit limits in the current codebase

  • FUSE vs headless workspace: The FUSE projection is a practical POSIX subset with limited locking and mmap semantics. Containers without /dev/fuse should run monofs-client --headless. An experimental C kernel module exists in-repo but is not the supported path.
  • Guardian rollbacks & CDK units: Failed applies record rollbackTo/rollbackReason and preserve the pushed desired manifest for retry — restoring an older archive tag is an explicit operator command. CDK-expressible intents collapse into one stack asset unit.
  • LB-Edge is L4 TCP only: No HTTP path routing, SNI termination, or active health probes beyond the 3-dial-failure passive circuit breaker.
  • Observability access control scope: Logs, traces, and federated SQL enforce per-partition compiled ACLs; metrics remain intentionally platform-visible without per-tenant row filtering.