--- status: accepted date: 2026-08-27 --- # Host the Metadata Catalog in the backend with Kysely The Metadata Catalog lives in the existing Fastify process as an isolated module rather than a microservice. It uses the existing `pg` driver through Kysely for typed queries, transactions and migrations; its routes, repository, readiness and diagnostics stay separate from the workflow, and catalog unavailability does not make sessions or SSE unavailable. ## Considered Options - A microservice would have kept the backend free of a database, but added deployment, authentication and failure modes for a single administrative context. - Plain `pg` would have avoided a dependency but required local infrastructure for transactions, row types and migration ordering and locking. - Drizzle or Prisma would have added a schema DSL, generators and toolchain to a service that keeps SQL and PostgreSQL constraints explicit. ## Consequences Migrations ship with the backend but run only through `catalog:migrate`, with migrator credentials separate from the runtime DML role.