ProficientNowTechRFCs
Product RFCs/DB Ops/RFC DBOPS 0002

Appendix A: Glossary and Indexes

RFC-DBOPS-0002                                                  Appendix A
Category: Standards Track                          Glossary and Indexes

A.1 Term Definitions

TermDefinition
AtlasA declarative database schema management tool used alongside Prisma Migrate for schema evolution in the platform.
Coexistence periodThe time during which both Prisma Client and Kysely operate simultaneously within backend-main, with each endpoint assigned to one query path.
Dual-execution modeA validation technique where both the Prisma and Kysely paths execute for the same request; the Prisma result serves the response while the Kysely result is compared offline.
KyselyA type-safe TypeScript SQL query builder that compiles typed query expressions to parameterized SQL without an intermediary engine process.
pg (node-postgres)A PostgreSQL client library for Node.js that provides the wire protocol implementation and connection pool (pg.Pool) used by Kysely's PostgresDialect.
pg.PoolThe connection pool provided by the pg driver, managing a bounded set of PostgreSQL connections shared across all tenant queries in the target architecture.
PgBouncerA connection pooler for PostgreSQL that mediates client connections to the database, supporting transaction and session pool modes.
Prisma ClientAn auto-generated ORM client that provides a TypeScript query API over PostgreSQL; the current query engine for tenant SQL operations.
Prisma EngineA Rust-based binary that Prisma Client uses internally for query generation, connection management, and result serialization.
Prisma MigrateA schema migration tool that generates and applies DDL changes based on the Prisma schema definition files.
PrismaManagerA static singleton in @pnats/schema-manager that caches TenantPrismaClient instances per tenant ID and manages tenant schema creation and migrations.
PrismaServiceA NestJS injectable service in @pnats/schema-manager that provides getClient(tenantId) for tenant-scoped Prisma access and manages ATS-main and tenant SQL clients.
Query-layer overheadThe latency contribution of the query generation, serialization, and engine processing that occurs between the application query API call and SQL dispatch to the database.
Relation hydrationThe process of composing multi-table queries to produce nested object graphs matching the response shape expected by API consumers.
Schema-per-tenantA multi-tenant isolation pattern where each tenant's data resides in a dedicated PostgreSQL schema named by the tenant's identifier.
search_pathA PostgreSQL session variable that determines schema resolution order for unqualified table references.
TenantPrismaClientThe Prisma-generated client for the tenant SQL database, instantiated per tenant and cached in PrismaManager.tenantClients.
withSchema()A Kysely method that returns a schema-qualified query builder, prefixing all table references with the specified schema name in generated SQL.

A.2 ADR Index

ADRDecisionRationaleDefined In
ADR-001Adopt Kysely as the replacement query builder for tenant SQL6.2.12.1
ADR-002Use withSchema() for per-query multi-tenant isolation6.2.12.3
ADR-003Reject Drizzle ORM due to schema-scoping maturity concerns6.2.22.3
ADR-004Reject raw SQL due to type safety violations6.2.32.3
ADR-005Reject TypeORM due to runtime overhead reintroduction6.2.42.3
ADR-006Retain Prisma Migrate and Atlas for schema migration—2.1.6
ADR-007Consolidate connection pooling to a shared pg.Pool6.2.12.1.5
ADR-008Phased migration with dual-path coexistence—5.1

A.3 Invariant Index

InvariantTitleSection
1Type Safety2.3
2Multi-Tenant Isolation2.3
3Feature Parity2.3
4Zero Data Regression2.3
5Rollback Capability2.3
6Connection Pool Stability2.3

A.4 Diagram Index

DiagramTypeSectionDescription
Figure 3-1flowchart3.1Target architecture showing dual query paths, connection layers, and poolers

On this page