Data models¶
Authoritative schema reference for all system domains. These are the canonical table and column definitions — do not invent alternative names or types. All code, tests, and AI-generated implementations must use the exact names specified here.
Conventions — Postgres (SD01–SD05, SD08)¶
- Primary keys:
uuid DEFAULT gen_random_uuid() - Money:
numeric(18,2) NOT NULL DEFAULT 0.00 - Currency codes:
char(3)(ISO 4217) - Timestamps:
timestamptz NOT NULL DEFAULT now() - Soft-delete:
deleted_at timestamptz - Audit columns:
created_at+updated_aton all mutable tables; append-only tables havecreated_atonly
Conventions — Snowflake Dynamic Tables (SD06, SD07)¶
- No FK constraints — referential integrity enforced by CDC pipeline (MOD-042 [CDC pipeline], ADR-003)
- Money:
NUMBER(18,2) - Timestamps:
TIMESTAMP_LTZ - Surrogate keys:
VARCHAR(SHA2 of natural key components)
Data models by system domain¶
| System domain | Platform | Tables / DTs | Data model |
|---|---|---|---|
| SD01 Core Banking | Postgres (Neon) | 7 tables | SD01-core-banking.md |
| SD02 KYC Platform | Postgres (Neon) | 7 tables | SD02-kyc-platform.md |
| SD03 AML Monitoring | Postgres (Neon) | 4 tables | SD03-aml-monitoring.md |
| SD04 Payments | Postgres (Neon) | 10 tables | SD04-payments.md |
| SD05 Credit | Postgres (Neon) | 8 tables | SD05-credit.md |
| SD06 Risk Platform | Snowflake | 13 Dynamic Tables | SD06-risk-platform.md |
| SD07 Data Platform | Snowflake + Iceberg | 5 tables + Iceberg | SD07-data-platform.md |
| SD08 App | Postgres (Neon) | 9 tables | SD08-app.md |
Cross-domain foreign key map¶
| Source table | Column | References | Direction |
|---|---|---|---|
accounts.postings |
payment_id |
payments.payments(id) |
SD01 → SD04 |
payments.payments |
account_id |
accounts.accounts(id) |
SD04 → SD01 |
payments.payments |
party_id |
party.parties(party_id) |
SD04 → SD02 |
credit.credit_applications |
party_id |
party.parties(party_id) |
SD05 → SD02 |
credit.loan_accounts |
account_id |
accounts.accounts(id) |
SD05 → SD01 |
aml.aml_alerts |
party_id |
party.parties(party_id) |
SD03 → SD02 |
app.customer_sessions |
user_id |
access.user_identities(user_id) |
SD08 internal |
treasury.tp_rates |
written by MOD-086 [Funds transfer pricing engine] | SD06 Snowflake write-back | SD01 ← SD06 |
payments.fx_rates |
written by MOD-085 [Market rates ingestion] | SD06 Snowflake write-back | SD04 ← SD06 |
All cross-domain reads go through the owning domain's API — never direct DB cross-connect. Snowflake receives all Postgres tables via CDC (MOD-042 [CDC pipeline], ADR-003). SD06/SD07 never query Postgres inline.
Related architecture documents¶
- ADR-001 — Postgres as the OLTP operational store
- ADR-003 — CDC pipeline: Neon to Snowflake
- ADR-024 (partially superseded by ADR-052 — naming convention correction only; all other decisions in ADR-024 remain in force) — Neon serverless Postgres hosting
- ADR-035 — Snowflake account configuration and data residency
- ADR-036 — Decision result publication: Snowflake to Neon