Database Schema Documentation
Welcome to the OpsHub Database Schema documentation. This section provides comprehensive information about OpsHub’s sophisticated multi-schema database architecture built on PostgreSQL via Supabase.Database Architecture
OpsHub implements a multi-schema PostgreSQL architecture that organizes data into specialized domains for better security, maintainability, and scalability.Key Features
- 15+ Specialized Schemas for domain separation
- Row-Level Security (RLS) for data isolation
- Multi-tenancy support with organization-based segregation
- Audit logging for complete traceability
- Optimized indexes for high-performance queries
Schema Organization
Core Investment Schemas
- Investment - Portfolio, holdings, and position management
- Performance - Performance attribution and analytics
- Risk - Risk metrics and monitoring
- Market Data - Pricing and reference data
Platform Schemas
- IAM - Identity and access management
- Agent - AI agent configurations and history
- Workflow - Temporal workflow definitions
- Integration - Third-party system integrations
- Vault - Secure credential storage
- Distribution - Investor communications and reporting
Governance Schemas
- Compliance - Regulatory compliance tracking
- Validation - Data validation rules and results
- Audit - Complete audit trail
Quick Links
Database Overview
High-level overview of the database architecture
Database Architecture
Technical details of the multi-schema design
Core Schemas
Investment, risk, and compliance schemas
Platform Schemas
IAM, agent, workflow, and system schemas
Database Technology
- Database: PostgreSQL 15+
- Platform: Supabase (managed PostgreSQL)
- Extensions: pgvector, TimescaleDB (optional)
- ORM: SQLAlchemy with type generation
- Migrations: Managed via Supabase CLI
Schema Access Patterns
Row-Level Security (RLS)
Every schema implements RLS policies that ensure:- Organization isolation - Data is scoped to organizations
- Team-based access - Granular permissions by team membership
- Role-based filtering - Access controlled by user roles
Performance Optimization
- Materialized views for complex aggregations
- Indexed lookups for common query patterns
- Partitioning for high-volume tables
- Connection pooling for efficient resource usage
Data Model Documentation
Detailed documentation for each schema includes:- Table definitions with column descriptions
- Relationships and foreign keys
- Indexes and constraints
- RLS policies
- Common query patterns
- Migration history
Getting Started
- Database Overview - Start here for architecture overview
- Core Schemas - Explore investment domain schemas
- Platform Schemas - Understand system schemas
- Reference Documentation - Complete data model reference
Navigation
Use the sidebar to explore:- Database Overview - Architecture and design principles
- Core Schemas - Investment, validation, risk, compliance, performance, market data
- Platform Schemas - IAM, agent, workflow, integration, vault, distribution
- Database Reference - Complete technical reference and quick guides
For development guides and database operations, see the Developer Docs section.