Skip to main content

Database Schema Documentation

Overview

JobHive uses PostgreSQL as its primary database with a carefully designed schema that supports AI-powered interview analysis, user management, billing, and comprehensive analytics. The database is optimized for performance with strategic indexing and efficient relationships.

Database Architecture

Core Design Principles

  • Normalization: Follows 3NF with strategic denormalization for performance
  • Scalability: Designed to handle millions of interview sessions
  • Performance: Strategic indexing and query optimization
  • Flexibility: JSON fields for dynamic data while maintaining structure
  • Audit Trail: Comprehensive tracking of changes and history

Core Database Models

1. User Management Models

User Model

Resume Model

OAuth Tokens Model

2. Company Management Models

Company Model

Job Model

3. Interview System Models

Interview Session Model (Core)

Sentiment Analysis Models

Sentiment History and Context

Skill Assessment Models

4. Assessment and Scoring Models

Assessment Framework

Cultural Fit and Behavioral Analysis

5. Learning and Development Models

Learning Resources

6. Billing and Subscription Models

Subscription Plans

Customer Subscriptions

Usage Tracking

7. Analytics and Reporting Models

Interview Statistics

Candidate Rankings

8. Scoring and Weighting Models

Score Weights

Database Relationships

Entity Relationship Overview

Performance Optimization

Critical Indexes

Partitioning Strategy

Data Integrity and Constraints

Business Logic Constraints

Foreign Key Relationships

Database Maintenance

Regular Maintenance Tasks

Automated Cleanup

Backup and Recovery

Backup Strategy

Recovery Procedures

Query Optimization Examples

Common Query Patterns

This database schema provides a robust foundation for JobHive’s AI-powered interview platform, with careful attention to performance, scalability, and data integrity.