Database & Drizzle ORM
Docs/Backend Core/Database & Drizzle ORM

Database & Drizzle ORM

Firebreak uses PostgreSQL hosted on Neon Serverless as its authoritative persistence engine, accessed through Drizzle ORM for compile-time type safety.

4 min read
•
Production Verified

Serverless Connection Pooling

Using @neondatabase/serverless over secure WebSockets (wss://), Firebreak multiplexes thousands of incoming queries from serverless functions across a managed pool, preventing connection exhaustion.

Relational Entity Map

The schema defines 17 tables organized into clear functional domains:

PostgreSQL ERD Diagram

PostgreSQL Relational Schema: Workspaces, Integrations, Services, Telemetry, and Mitigation Actions

Table Inventory Overview

CategoryTablesPrimary Purpose
Identity & Tenancyuser, session, account, workspaces, workspace_membersAuthentication (Better Auth), multi-tenant organization boundaries.
Integrationsgithub_installations, vercel_connectionsAES-256-GCM encrypted tokens for GitHub App and Vercel.
Telemetryservices, alertsMonitored production apps and incoming raw error payloads.
Incidents & Mitigationincidents, suspects, analyses, actions, probes, timeline_eventsState machine tracking active outages, ranked culprit commits, staged proposals, canary probes, and immutable audit logs.
Auxiliariesmcp_api_keys, processed_webhooks, email_deliveriesHashed API keys for AI agents, webhook dedup, and Resend audit logs.