Skip to content

System architecture

CDNFoundry is a modular Laravel monolith surrounded by specialized data-plane services. PostgreSQL stores desired state. PowerDNS data, signed edge artifacts, runtime snapshots, cache contents, ClickHouse events, and aggregates are derived or rebuildable.

PlaneComponentsResponsibility
ManagementLaravel, Filament, Horizon, schedulerAuthorization, validation, desired state, operations, reconciliation
Durable control dataPostgreSQL, ValkeyDesired state, audit, operation records, queues, sessions, cache
Authoritative DNSDNSdist, PowerDNS, PowerDNS PostgreSQLPublic DNS ingress and private authoritative answers
Edge HTTPEdge agent, OpenResty cellsArtifact activation, TLS selection, proxying, cache, security
TelemetryVector, ClickHouse, Prometheus, AlertmanagerBounded event delivery, analytics, metrics, alerts

Only DNSdist, intended OpenResty listeners, and the browser/API reverse proxy belong on public ingress. Edge control uses mutual TLS. Telemetry and PowerDNS API gateways are source restricted in the production overlays. Internal databases, Valkey, ClickHouse, raw metrics, and PowerDNS itself remain private.

Architectural decisions

PostgreSQL owns intent

The control schema stores what the operator asked for, who may change it, which revision is current, and whether derived targets acknowledged it. PowerDNS tables, artifacts, active edge directories, cache objects, and analytics aggregates can be rebuilt.

Reconciliation owns side effects

Controllers and Filament actions validate, authorize, and commit desired state. They do not call PowerDNS, ACME, an edge, an origin, or ClickHouse synchronously to finish a mutation. Unique jobs coalesce work, skip obsolete revisions, validate candidates, activate atomically, and record receipts.

Data planes remain autonomous

An outage of Laravel, PostgreSQL, Valkey, ClickHouse, or Vector must not stop an already-configured DNS answer or HTTP request. DNSdist and OpenResty operate from private runtime state, and the edge agent retains active and previous snapshots.

Scale uses bounded shared units

Domains are data inside shared DNS and OpenResty runtimes. Scale comes from workers, DNS capacity, telemetry capacity, edge nodes, and bounded cells—not a normal per-domain container, daemon, timer, cache directory, or reload.

Boundary test

If a feature requires Laravel, PostgreSQL, ClickHouse, or an external API during a customer DNS or HTTP request, it violates the serving boundary.

Failure isolation

FailureExisting trafficManagement/recovery
Laravel or PostgreSQL unavailableDNS and HTTP continue from active runtimeUI, mutations, and reconciliation pause
One PowerDNS target failsOther authoritative targets continueFailed target keeps its last valid zone
Invalid edge artifactActive cell continuesCandidate is rejected and failure recorded
ClickHouse or Vector unavailableDNS and HTTP continueAnalytics becomes partial or unavailable
Origin unavailableCache/stale policy may serve eligible objectsOrigin health and errors become visible

Continue with Components, Data flows, and Data model.

CDNFoundry documentation