Database architecture
The server database has two storage layers: shared control tables in the public schema and business-data tables in a separate PostgreSQL schema for each profile. SQL migrations create the shared layer; the server creates and evolves profile schemas from table definitions.
Shared control tables
Section titled “Shared control tables”| Table | Purpose |
|---|---|
schemas |
The profile catalog — one row per profile |
table_definitions |
Table shapes, column metadata, kind, family root, display columns |
table_definition_columns |
Physical-to-alias mapping for every column |
table_definition_links |
Which column links to which table |
column_alias_rename_history |
History of alias renames |
table_scripts, script_dependencies |
Steel scripts and their dependency graph |
table_validation_rules, validation_rule_definitions, validation_sets, validation_set_rules |
Validation rules and reusable sets |
table_accounting_definitions, accounting_transfer_definitions |
Accounting behavior of tables |
table_temporal_raw_values |
Raw temporal values |
search_index_outbox |
Pending search-index jobs |
roles, role_permissions, users, auth_events |
Identity, roles, grants, and the audit log |
rbac_policy_version |
A counter bumped on role or grant changes |
document_data_runs, document_data_snapshots |
Versioned rendered documents |
quantity_ledger_script_contributions |
Stored quantity effects used during reconciliation |
table_data_post_idempotency |
Replay protection for inserts |
ecb_import_batches, ecb_reference_rate_observations, ecb_conversion_evidence |
ECB reference rates and conversion evidence |
accounting_periods, accounting_period_balances, accounting_profile_approvals, accounting_period_account_mappings, accounting_period_denomination_balances |
Accounting control data |
Migrations also install trigger functions that enforce journal-close rules, protect accounting audit tables, and bump row revisions.
Per-profile schemas
Section titled “Per-profile schemas”Each profile schema contains its user-defined tables and backend-owned system tables. Their physical columns and relationships are described by the shared catalog, while their rows remain inside the profile schema. See Profiles and catalog for profile creation, naming, and provisioned system tables.
Backup and restore treat the control tables and every profile schema as one database. See Migrations for schema evolution and PostgreSQL backups for data protection.