The concept A data model is a set of business facts
In financial systems, the data model represents business facts and how they relate. Apex must answer: which provider reported this payment, which loan it belongs to, whether it settled and against which record, why it became an exception, who investigated it, whether the result changed, and what evidence supports the final status. If the model cannot answer these, the platform fails its users.
Start with the business Entities and relationships
Eight conceptual entities: payment transaction, settlement record, loan account, reconciliation result, exception case, audit event, provider and ingestion batch. They do not imply eight databases or eight services. The relationships: a payment is reported by one provider and belongs to one loan account; it may have several processing attempts, produces a reconciliation result and may create an exception. A settlement file contains many records. An exception may have many investigation actions. An audit event describes a change made by a user or by the system.
In detail The logical data model
| Entity | Important fields |
|---|---|
| Payment transaction | Internal payment ID, provider ID, provider transaction ID, loan account ID, amount in minor units, currency, provider-reported status, transaction and ingestion timestamps, source payload reference |
| Settlement record | Internal ID, bank reference, settlement batch ID, amount in minor units, currency, settlement date, source file reference, processing status |
| Reconciliation result | Reconciliation ID, payment ID, settlement record ID if matched, match status, matching rule version, matching evidence, created and updated timestamps |
| Exception case | Exception ID, reconciliation ID, category, severity, case status, assigned user, resolution code and timestamp |
| Audit event | Audit event ID, entity type and ID, actor identity, action, previous and new state references, timestamp, correlation ID |
Rules that must never break Financial invariants
An invariant is a rule that must hold after every operation, whatever fails. Write them down in the architecture, and say what enforces each one, because Module 07 must implement every line and test it:
| Invariant | Rule | Enforced by |
|---|---|---|
| Amount precision | Amounts are integer minor units (cents). An amount with more decimals than the currency allows is rejected, never rounded. Arithmetic overflow is an error, never a wrapped number | Adapter validation; CHECK constraint (amount greater than 0) |
| Currency | USD only in v1. Amounts in different currencies are never added or compared | Validation; CHECK constraint |
| One payment per provider transaction | At most one payment per (provider, provider transaction ID). Same ID with different content is refused, never overwritten | UNIQUE constraint; full SHA-256 of the normalized payload |
| One batch per file | A settlement file with the same content is processed once, even after a restart | UNIQUE constraint on the full file SHA-256 |
| Settlement control totals | Lines read equal the trailer count, and accepted amounts plus readable rejected amounts equal the trailer total. Otherwise the batch cannot be COMPLETED | Batch validation, with the unexplained amount reported |
| Reconciliation uniqueness | A payment is MATCHED at most once, and a settlement record is MATCHED at most once | Partial unique indexes on MATCHED results |
| No silent changes | Nothing financial is deleted or edited in place; corrections are new entries, each with an audit record in the same transaction | Append-only tables; no DELETE permission; audit written in the transaction |
Explain any result Design for traceability
A finance user must be able to follow a transaction: source record, normalized record, reconciliation result, exception case, resolution, audit history. Never overwrite original provider data with normalized values. Keep the source, or a protected, unchangeable reference to it, beside the normalized version.
Who owns each fact Data ownership
| Data | Authoritative source |
|---|---|
| Provider transaction status | Payment provider |
| Bank settlement record | Banking system |
| Loan account information | Loan servicing system |
| Internal reconciliation status | Apex reconciliation platform |
| Exception investigation history | Apex exception management |
| User identity | Enterprise identity provider |
Apex may keep copies or derived data, but a copy must never silently become authoritative for a fact owned elsewhere.
Rules on data Retention and privacy
Financial records come with retention, access and audit rules. The architecture must identify retention periods, sensitive fields, encryption needs, data masking, access logging, deletion constraints, legal holds, and backup and recovery policies.
Practice Design the data model
Practical exercise
Exercise 04: logical data model and ownership
Produce the data architecture for Apex.
- A logical entity relationship diagram with keys and cardinalities.
- A field-level definition for the core entities.
- A data ownership matrix.
- A retention and privacy checklist.
- A traceability example for one payment.
Show a sample traceability example
- Source: Provider A payload for PAY-1001, stored unchanged in protected object storage, referenced by source_payload_ref.
- Normalized: sourceSystem PROVIDER_A, amountMinorUnits 42550, currency USD.
- Result: UNMATCHED under rule version 1, evidence: no settlement with this reference after the agreed window.
- Exception and resolution: missing settlement; an analyst finds it under another bank reference; a supervisor approves the manual match.
- Audit: each step recorded with actor, time and correlation ID.
3 questions
Check your understanding
What you can do now
- Model business entities, relationships and core fields.
- Design end-to-end traceability that keeps the original.
- Write a data ownership matrix.
- List retention and privacy questions for the customer.