Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/adr/0002-postgresql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# ADR-0002: PostgreSQL as the relational database

- **Status:** Accepted
- **Date:** 2026-11-29

## Context

Basira stores structured data with clear relationships (organizations, users,
tickets, replies), and needs transactions and constraints. Relationships live
inside a module; modules do not share foreign keys (see ADR-0001). The
knowledge base feature will also need similarity search over embeddings.

## Decision

Use PostgreSQL, accessed through Entity Framework Core (Npgsql provider).
Each module uses its own schema in the same database.

## Alternatives considered

- **SQL Server:** very common in the .NET ecosystem and has excellent tooling.
It also runs on Linux and in containers, so portability was not the deciding
factor. It is a valid choice for this project.
- **MySQL:** fine for relational data, but weaker fit for the planned
vector-search feature.

## Consequences

**Positive**
- Free and open source, with no licensing cost when deploying.
- Mature EF Core provider and good Linux/cloud hosting support.
- The pgvector extension can support embeddings search in the AI phase.

**Negative**
- The author has not used PostgreSQL before, so there is a learning curve.
- EF Core migrations are provider-specific, so switching databases later means
regenerating them.