Skip to content

Database Architecture

Status: Implemented


Overview

The Nivron data model is designed to support a multi-tenant SaaS platform while keeping domain boundaries clear and easy to evolve. The current implementation establishes the platform foundation and will be expanded through versioned database migrations.

The database layer is shared by all platform services and is managed through Alembic.


Design Principles

  • Schema separation by domain.
  • Version-controlled database evolution.
  • UUID v7 as the primary external identifier.
  • Forward-compatible migrations.
  • Business modules own their data model.

Current Schemas

Schema Purpose
core Core platform entities and metadata.
identity Identity and access foundation.

Migration History

Version Description Status
0001 Platform schemas Implemented
0002 Platform metadata Implemented
0003 Organizations Implemented
0004 Users Implemented

Current Entity Relationships

erDiagram

    ORGANIZATIONS ||--o{ USERS : owns

    ORGANIZATIONS {
        uuid uuid
        string slug
        string name
        string status
    }

    USERS {
        uuid uuid
        string username
        string status
    }

Database Evolution

All structural changes are introduced through Alembic migrations. Existing migrations remain immutable after publication, ensuring that every deployment can reproduce the same database state from version history.


Architectural Principles

The database is organized around business domains rather than application features. This approach keeps responsibilities isolated and simplifies future expansion as new modules are introduced.


  • Platform Framework
  • Identity Foundation
  • Organizations

Next Step

Continue with Identity Foundation to understand how organizations and users establish the foundation of the Nivron identity model.