Skip to main content
Version: V2-Next

ADR 049: PostgreSQL artifact registry as the primary persistence layer

Date: 2026-07-15

Status: Accepted

Decision Makers: @derlinne, @luckey

Context​

Model Forge needs a single source of truth for all model artifacts that survives restarts and stores the complete reference graph.

Decision​

A PostgreSQL-backed artifact registry owned by Model Forge is the single source of truth for all model artifacts. Model Forge owns the schema (tables artifact, artifact_version, artifact_representation, artifact_reference, xsd_namespace), migrated automatically with Flyway on startup. The in-memory dependency graph is only an ephemeral index, rebuilt from the registry.

Rationale​

  • Artifact content is stored per version and format in artifact_representation as canonical JSON in jsonb (raw XSD as text); facade reads are projections built at the boundary, never persisted as ORM entities (ADR 058).
  • The complete reference graph, including cycles, is stored relationally in artifact_reference (ADR 056).
  • Versioning is Model-Forge-owned SemVer (ADR 057), not delegated to a registry's version model.
  • One fewer external service to deploy, secure and operate.
  • Model Forge builds the dependency graph and inlining/bundling itself (ADR 054, ADR 055).

Consequences​

All artifacts live in PostgreSQL — the single source of truth. The application requires a datasource to start; on startup the in-memory cache is rebuilt from the registry. Model Forge performs no schema-compatibility calculation (ADR 057).

See also​