---
title: "Banking Database Design for UK Firms: Ledger and CASS 15"
description: "Ledger design for UK EMIs and banks: sterling postings, ACID and idempotency, CASS 15 reconciliation, Faster Payments references and retention."
url: "https://crassula.io/en-gb/guides/banking-database-design/"
lang: "en-GB"
last_updated: "2026-11-28"
image: "https://crassula.io/static/images/guides/banking-database-design/database-shards-1440.fd26e13a7ca0.jpg"
alternates:
  "en": "https://crassula.io/guides/banking-database-design/"
  "en-GB": "https://crassula.io/en-gb/guides/banking-database-design/"
  "de": "https://crassula.io/de/guides/banking-database-design/"
  "es": "https://crassula.io/es/guides/banking-database-design/"
  "fr": "https://crassula.io/fr/guides/banking-database-design/"
  "lv": "https://crassula.io/lv/guides/banking-database-design/"
  "x-default": "https://crassula.io/guides/banking-database-design/"
index: "https://crassula.io/en-gb/llms.txt"
---

# Banking Database Design for UK EMIs and Banks: Ledger and CASS 15

For a UK EMI, payment institution or bank, database design starts with a sterling double-entry ledger: append-only postings in exact decimal amounts, each written in one ACID transaction with an idempotency key, plus the references needed to reconcile safeguarded funds every business day under CASS 15 and to match Faster Payments, Bacs and CHAPS statements.

![Banking Database Design for UK EMIs and Banks: Ledger and CASS 15](https://crassula.io/static/images/guides/banking-database-design/database-shards-960.05b9afd080ad.jpg)

- Author:
  [Alona Belinska](https://www.linkedin.com/in/alona-belinska/)
- With the Expertise of:
  [Ivan Sharov](https://www.linkedin.com/in/ivansharov/)
- Last edited 28 Nov 2026, 16 min read

## What a UK firm's database has to prove

Every business day a UK e-money or payment institution has to tell the FCA, in effect, how much it owes its customers in each currency and where that money is held. Since 7 May 2026 that daily figure is a legal requirement under [CASS 15](https://crassula.io/en-gb/guides/licenses/uk-safeguarding-cass-15/). Banks face the same question from the PRA in a different form. The answer comes from one place: the ledger. A Faster Payment, a card purchase in Spain and the monthly fee on a business account all end up as rows in a posting table, and every balance on a screen is calculated from them.

Get the ledger model wrong and the symptom is not a slow page. It is a reconciliation break, a qualified safeguarding audit and money nobody can trace. Three rules prevent most of that, whatever engine sits underneath the wider [banking architecture](https://crassula.io/en-gb/guides/banking-architecture/).

#### Write once

Once an entry is posted it stays. An error is corrected by a new reversing entry, so the history auditors read is complete.

#### Two sides to every movement

Each debit has an equal credit. Within one transaction and one currency the entries net to zero, so a missing penny shows up at once.

#### Balances are calculated

Postings are the truth. A stored balance is only a cache, and a scheduled job proves it still equals the sum of its postings.

In the schema that translates into `NUMERIC` columns or integer pence for every amount (a `FLOAT` cannot hold £0.10 exactly), constraints that live in the database rather than only in code, and a posting table that the application can never update. All three cost nothing on day one and a great deal once customer money is in production.

### Let's discuss your project and see how we can launch your digital banking product together

[Request demo](https://crassula.io/en-gb/request-demo/)

## The entities of a sterling ledger

University ER diagrams of a "bank system" are built around branches, staff and loans. A UK fintech's schema is built around money moving, and five entities carry most of it:

- **Customer to account, one to many.** A sole trader may hold a sterling account and a euro wallet; joint accounts need a separate holder table.
- **Product to account, one to many.** Each account is an instance of a product, such as an e-money account, a business current account or savings, with its rules stored as data.
- **Transaction to posting, one to many.** One business event, say an outgoing Faster Payment with a fee, creates several postings that balance.
- **Account to posting, one to many.** A statement is just the account's postings in booking order.
- **Account to hold, one to many.** Card authorisations and payments awaiting the scheme are reservations, kept apart from postings.

| Entity | Main columns | Why it is shaped this way |
| --- | --- | --- |
| Customer | customer\_id, kind (individual or business), status, risk\_rating, created\_at | Personal data encrypted at column or application level under UK GDPR. Identity checks sit in their own append-only table. |
| Product | product\_id, kind, currencies, fee\_rules, interest\_rules, limits | An e-money account and a savings account differ by settings, so a new product needs no migration. |
| Account | account\_id, customer\_id, product\_id, currency, sort\_code, account\_number, IBAN, name\_for\_cop, status, ledger\_balance, available\_balance, version | Sort code and account number are what UK payers use; the registered name answers Confirmation of Payee checks. `version` allows optimistic locking. |
| Transaction | transaction\_id, idempotency\_key, kind, rail, scheme\_ref, status, created\_at | The rail (Faster Payments, Bacs, CHAPS, card, SEPA) and its reference make statement matching possible. The idempotency key is unique. |
| Posting | posting\_id, transaction\_id, account\_id, amount, currency, side (DR or CR), booking\_date, value\_date | Never updated. Booking date says when it was recorded; value date decides interest. |

Keep reference data and the ledger normalised to third normal form, because copies of customer or product data drift apart. Denormalise only in read models such as statements or a search index, which you can drop and rebuild from postings. Alongside customer accounts, hold a **general ledger** of internal accounts (customer funds, safeguarding, fee income, suspense) so the trial balance and the safeguarding figure come from the same entries as customer statements.

---

## A ledger schema in PostgreSQL

Three tables hold the core, and constraints do most of the protective work. The example is PostgreSQL, the engine behind most UK fintech ledgers; the same ideas apply on Oracle, SQL Server or distributed SQL.

```text
CREATE TABLE transactions (
  transaction_id   uuid PRIMARY KEY,
  idempotency_key  text NOT NULL UNIQUE,
  rail             text NOT NULL CHECK (rail IN ('fps','bacs','chaps','card','sepa','internal')),
  scheme_ref       text,
  status           text NOT NULL CHECK (status IN ('pending','posted','reversed')),
  created_at       timestamptz NOT NULL DEFAULT now()
);

CREATE TABLE postings (
  posting_id      bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  transaction_id  uuid NOT NULL REFERENCES transactions,
  account_id      uuid NOT NULL REFERENCES accounts,
  amount          numeric(20,4) NOT NULL CHECK (amount > 0),
  currency        char(3) NOT NULL DEFAULT 'GBP',
  side            char(2) NOT NULL CHECK (side IN ('DR','CR')),
  booking_date    date NOT NULL,
  value_date      date NOT NULL
);

REVOKE UPDATE, DELETE ON postings FROM app_role;
```

Look closely at three lines. The unique `idempotency_key` means an app that retries a £250 transfer after a timeout gets the first result back, not a second payment. Positive amounts with an explicit side are easier for an auditor to read than signed values. Revoking `UPDATE` and `DELETE` from the application role makes "append-only" something the database enforces rather than a team habit. The posting function checks that debits equal credits for each currency before it commits, and the nightly trial balance checks again.

---

## The balances a UK customer sees

An account carries several balances at once. Confusing them is the usual reason for overdrafts nobody approved, for instance when a card authorisation in a hotel reserves £300 three days before clearing turns it into a posting.

| Balance | Meaning | Source and use |
| --- | --- | --- |
| Ledger | Total of posted entries | The postings table; used for statements, accounting and safeguarding |
| Held | Money reserved but not yet moved | The holds table: card authorisations, outgoing payments at the scheme, compliance blocks |
| Available | Ledger less holds, plus any arranged overdraft | Calculated; every spending decision uses it |
| Incoming, not settled | Credits announced but not received | Shown in the app, never spendable |

The card cycle shows why holds need their own table. The authorisation creates a hold and cuts the available balance. Clearing arrives one to three days later, sometimes for a different amount (a tip, a hotel extra, an exchange rate), creates the postings and releases the hold. An unmatched hold expires after a set number of days. A purchase in euros adds an FX leg: the customer's sterling account is debited, a currency position account is credited, and a second pair books the euro side. When a provider such as [Currencycloud](https://crassula.io/en-gb/connectors/app/currencycloud/) carries out the conversion, store its trade reference on the transaction so its statement can be matched line by line.

---

## Safeguarding reconciliation and the resolution pack

Under [PS25/12](https://www.fca.org.uk/news/press-releases/payment-safeguarding-rules-changes), an authorised EMI or PI reconciles every business day, sends a monthly safeguarding return to the FCA and has an annual safeguarding audit. A good schema makes each step a query rather than a spreadsheet.

- **Inside the ledger:** debits equal credits per currency across all accounts, and each cached balance equals its postings.
- **Against the outside world:** postings matched to statements from the safeguarding and operational banks, card clearing files and provider reports, using the references stored when the entry was written.
- **The safeguarding figure:** relevant funds owed to customers per currency, compared with the balance in the safeguarding account, for example at [ClearBank](https://crassula.io/en-gb/connectors/app/clearbank/), with any shortfall topped up and recorded.

Anything that does not match goes to a suspense account with an owner and an ageing report, never into a quiet adjustment. The same policy statement brought in a resolution pack under [CASS 10A](https://handbook.fca.org.uk/handbook/CASS/10A): if an insolvency practitioner is appointed or the FCA or Bank of England asks, each document must be retrievable within 48 hours. Archives that take days to restore fail that test, so keep the records the pack lists in storage you can query directly. The [UK payment institution licence](https://crassula.io/en-gb/guides/licenses/uk-api/) guide covers what the FCA wants to see at authorisation.

---

## ACID and idempotency when Faster Payments retries

A debit that commits without its credit is lost money, so a ledger needs every part of ACID.

| Property | In a payments ledger | How to enforce it |
| --- | --- | --- |
| Atomicity | Every posting of a transfer lands, or none does. | One database transaction per business event; a saga with compensating entries when legs sit in different systems. |
| Consistency | Each transaction balances per currency and all constraints hold. | CHECK and foreign keys plus a balance assertion before commit. |
| Isolation | Two payments at the same moment cannot both use the same £100. | `SELECT ... FOR UPDATE` on the account, or a version column; SERIALIZABLE for complex rules. |
| Durability | A confirmed payment survives a crash. | Write-ahead log and synchronous replication to a standby in another zone. |

**Idempotency** matters more on instant rails than anywhere else. A Faster Payments confirmation can time out while the money has already gone, a phone on a train resends, and card networks deliver duplicates. Every write endpoint takes an idempotency key, stores it in the same transaction as the postings and replays the saved result on repeat. Webhooks from your agency bank or card processor get the same treatment: a unique constraint on the provider's event ID, and duplicates ignored.

**Event sourcing** goes further, treating the ordered event log as the only record and rebuilding balances by replay. It gives audit trails and point-in-time answers ("what did this customer hold at 09:15 on 3 March?") for free, but each balance read then needs snapshots or a CQRS model. Most UK teams settle on an append-only posting table as the log and a cached balance updated in the same transaction.

---

## Which database engine

Britain's high street banks still run large parts of their cores on mainframes, vendor packages often sit on Oracle, and most challengers and EMIs use PostgreSQL. Pick by transaction model and team skills.

| Engine | Where you find it | Trade-off |
| --- | --- | --- |
| Mainframe (Db2, IMS) | Long-established bank cores with heavy batch work | Huge proven throughput; scarce skills and slow change |
| Oracle, SQL Server | Packaged core systems at larger banks | Mature tools; licence fees |
| PostgreSQL (incl. Aurora, AlloyDB, Azure) | Most EMI, PI and challenger ledgers, often in a London cloud region | Solid ACID and `NUMERIC`; beyond one primary you need partitioning or shards |
| Distributed SQL (CockroachDB, YugabyteDB, Spanner) | Ledgers spread across regions, very high write rates | Serializable across nodes; more latency per write and more to operate |
| Specialist ledgers (e.g. TigerBeetle) | A fast double-entry component inside a larger system | Excellent posting speed; customer, product and compliance data live elsewhere |

Document and key-value stores have a place next to the ledger, for sessions, notifications, search and identity documents, but seldom as the ledger, since atomic multi-row writes and constraints are what keep money safe. Firms leaving a mainframe usually tie the database change to their [core banking modernisation](https://crassula.io/en-gb/solutions/core-banking/guides/core-banking-modernization/) and move the ledger last.

---

## When volume forces you to shard

Sharding spreads the ledger across independent nodes once a single primary cannot take peak writes. Few UK EMIs get there, but it pays to know the ceiling. The largest real-time scheme in the world, India's UPI, passed 20 billion transactions a month in August 2025 and handled 754 million on 18 October 2025, roughly 8,700 a second averaged over that day (our arithmetic; peaks are much higher).

UPI monthly transactions, August to December 2025

| Category | Transactions (billion) |
| --- | --- |
| Aug | 20.01 |
| Sep | 19.63 |
| Oct | 20.7 |
| Nov | 20.47 |
| Dec | 21.63 |

Source: [NPCI UPI product statistics (provisional monthly data), as reported by Business Today, Jan 2026](https://www.npci.org.in/what-we-do/upi/product-statistics). A national scheme dwarfs any single UK firm; the figures show the scale a payments database can meet.

---

## Shard strategies for a UK group

For most ledgers, hashing the account or customer ID is the right start: an account's postings stay on one node and writes spread evenly. A shard map tells the application where each key lives.

| Approach | Mechanism | Good for | Catch |
| --- | --- | --- | --- |
| Hash | A hash of account\_id chooses the node; consistent hashing limits moves when nodes are added. | Even load across accounts. | Queries over many accounts hit every shard. |
| Range | Key or date ranges map to fixed nodes. | History and archive partitions. | New accounts and today's postings crowd the latest shard. |
| By legal entity | UK customers on the UK entity's shards, EU customers on the EU entity's. | Separate books per regulated entity after Brexit, data location. | A payment between entities becomes a cross-shard transaction. |
| Directory | A lookup table places each tenant or very large client. | Platforms hosting several brands, or one dominant business client. | The directory itself must be replicated and always available. |

Try the cheaper steps first: partition postings by booking month, add read replicas, move reporting to a warehouse and fix hot rows. A shard key needs high cardinality (never currency, country or status), and the initial shard count should be generous, because resharding a live ledger is among the hardest jobs in this field. Platforms running several brands on one ledger make the same choice per tenant, as covered in [banking multi-tenancy](https://crassula.io/en-gb/guides/banking-multi-tenancy/).

---

## Hot accounts, cross-shard transfers and reads

The limit is rarely total volume. It is a handful of internal accounts touched by almost every transaction: fee income, the settlement account with your agency bank, the safeguarding account. Lock their balance row on each write and the whole ledger queues behind it.

- **Leave internal balances unlocked.** Append postings to those accounts without a cached balance and compute it on read or from snapshots.
- **Split a hot account** into numbered sub-accounts picked at random, and add them up for reporting.
- **Sweep in batches:** gather small fee entries and move them to the general ledger once a minute or once an hour.
- **Cross-shard payments** run as a saga: debit into a transit account on shard A, credit on shard B, reverse step one if step two fails, all under one idempotency key. Two-phase commit is rarely worth the latency.

Scale reads separately. Balances and statements can come from replicas, while analytics, transaction monitoring and returns to the FCA or Bank of England go to a warehouse (BigQuery, Redshift, Snowflake) fed by change data capture. This CQRS split also underpins [banking microservices](https://crassula.io/en-gb/guides/banking-microservices/), where the ledger service is the only one that writes postings.

---

## Records for Confirmation of Payee, APP claims and UK GDPR

UK payment rules add data you will be asked for later. [Confirmation of Payee](https://www.psr.org.uk/publications/policy-statements/ps262-specific-direction-17-confirmation-of-payee-removing-the-expiry-date/) covers around 400 providers since the PSR extended it in October 2024, so store the name each customer registered and the outcome of every check you made or answered (match, close match, no match), with the warning shown. When an [APP scam reimbursement](https://www.psr.org.uk/our-work/app-scams/) claim arrives, up to £85,000 and split 50:50 between sending and receiving firm, those rows are your evidence of what checks and warnings the customer saw.

Personal data falls under UK GDPR and the Data Protection Act 2018. Record which store holds what and where it is processed, especially if a supplier handles any of it outside the UK, and keep identity check results from providers such as [Sumsub](https://crassula.io/en-gb/connectors/app/sumsub/) with the date of the check.

---

## Retention, backup and recovery under UK rules

The Money Laundering Regulations 2017 (regulation 40) require customer due diligence and transaction records to be kept for five years after the relationship ends or the occasional transaction completes. Company and tax rules often ask for six years of accounting records, and many UK firms simply design for ten. An EU entity in the group follows the EU AML rules, which also set five years.

| Need | How the database meets it |
| --- | --- |
| Tamper-evident history | Append-only postings enforced by permissions, plus an audit log of every change to reference data with old and new values. |
| Five years and more | Monthly partitions, older ones moved to cheaper storage that can still be queried; deletion only after every period has run out. |
| Backup and restore | Point-in-time recovery from WAL archives, daily full backups and scheduled restore drills, with RTO and RPO written into the continuity plan. |
| Sensitive fields | Sort codes, account numbers and ID document numbers encrypted with keys in a KMS or HSM, masked outside production. See [key management in banking](https://crassula.io/en-gb/guides/key-management/). |
| Access | Row-level security for tenants, read-only reporting roles, logged and time-limited administrator access. |

Recovery targets come from the business. Under the FCA and PRA operational resilience rules ([PS21/3](https://www.fca.org.uk/publications/policy-statements/ps21-3-building-operational-resilience)), in full since 31 March 2025, the ledger's RTO and RPO must keep services such as sending a payment within the impact tolerance the board set, and restore drills form part of the evidence. A common set-up is synchronous replication to a standby in a second London availability zone (RPO close to zero) plus asynchronous copies in another region. An EU entity is also in DORA scope; see [DORA for payment institutions](https://crassula.io/en-gb/guides/dora-for-payment-institutions/). Authorisation itself is covered in the [FCA EMI licence](https://crassula.io/en-gb/guides/licenses/uk-emi/) guide.

---

## Checklist before you build or buy

Write your own ledger only if the ledger is the product; otherwise a core platform gives you a tested model. Either way, test the design against these points:

- Exact decimal or pence amounts, with a currency on every posting.
- Postings the application cannot update or delete; corrections as reversals.
- Transactions balanced before commit and in the nightly trial balance.
- Unique idempotency keys on write APIs and on provider webhooks.
- A holds table, and written definitions of ledger, held and available balances.
- Booking and value dates on each posting.
- Sort code, account number and the Faster Payments, Bacs or CHAPS reference stored for matching, plus UETRs for SWIFT.
- The CASS 15 figure as one query per currency, and the CASS 10A pack retrievable within 48 hours.
- A plan for hot internal accounts before launch.
- Reporting and monitoring off the primary, through replicas or CDC.

---

## Where Crassula fits

Crassula gives UK EMIs, payment institutions and fintechs a working ledger, so engineers configure products rather than design tables. The [core banking platform](https://crassula.io/en-gb/products/core-banking/) provides double-entry accounts, transactions with statuses, holds, fees, multi-currency accounts and a full audit trail, connected to banks, FX and identity providers. The [core banking system](https://crassula.io/en-gb/solutions/core-banking/guides/what-is-core-banking/) guide shows how the modules fit together.

Pricing is published: £17,500 setup plus £7,000 a month with every module included (see [pricing](https://crassula.io/en-gb/prices/)). If you are weighing a home-built ledger against a platform, [book a demo](https://crassula.io/en-gb/request-demo/) and we will go through the data model with your engineers.

---

## FAQ

### How should a UK EMI design its ledger database?

Begin with customer, product, account, transaction and posting tables. Make postings append-only and balanced per transaction, use exact decimal types, enforce constraints in the database and give each write an idempotency key. Store the references needed for CASS 15 reconciliation from day one.

### Which databases do UK banks and fintechs use?

Older bank cores still run on mainframes (Db2, IMS) or Oracle. Most UK challengers, EMIs and PIs use PostgreSQL, usually as a managed cloud service, and a few high-volume platforms use distributed SQL. The ledger almost always sits in a relational ACID database.

### What tables does a payments ledger need?

Customer, product, account, transaction and posting, surrounded by holds, fees, limits, identity checks, payees, cards and an audit log. The schema follows money movement rather than an org chart of branches and staff.

### Why double-entry in the database?

Each movement has an equal and opposite entry, so the postings of every transaction net to zero. Money cannot appear or vanish without breaking the trial balance, and the same data serves customer statements, the firm's accounts and the safeguarding figure.

### How do you keep balances in step with postings?

Update the cached balance in the same transaction that writes the postings, under a row lock or version check, then recalculate every balance daily from postings and flag differences. For very busy internal accounts, drop the cache and compute from postings or snapshots.

### What is the difference between ledger and available balance?

The ledger balance totals posted entries. The available balance takes away holds such as uncleared card authorisations and adds any arranged overdraft. Spending checks use available; statements and safeguarding use ledger.

### What does CASS 15 mean for the database?

Since 7 May 2026 an authorised EMI or PI reconciles safeguarded funds every business day, files a monthly return and has an annual audit. The ledger must produce the amount owed to customers per currency on demand and match it to bank statements automatically.

### What is the CASS 10A resolution pack?

A set of records an insolvency practitioner would need to return customer funds. Under CASS 10A each document must be retrievable within 48 hours of an appointment or an FCA or Bank of England request, so keep it in queryable storage.

### What UK-specific fields does the ledger need?

Sort code and account number on accounts, the Faster Payments, Bacs or CHAPS reference on transactions, the name registered for Confirmation of Payee and the outcome of each check. They support scheme reconciliation and APP reimbursement claims.

### When does a UK fintech need sharding?

Only when one primary can no longer absorb peak writes after partitioning, replicas and offloading reports, or when separate legal entities need separate books. Most early EMIs never reach that point.

### How long must UK firms keep transaction records?

At least five years after the transaction or the end of the relationship under regulation 40 of the MLRs 2017. Tax and company rules often add more, so many firms keep ledger data for ten years in partitioned, queryable archives.

## Create a digital bank in a matter of days

[Request demo](https://crassula.io/en-gb/request-demo/)

![Companies using Crassula](https://crassula.io/static/images/home/cta/logos.d2974e5bd7da.png)

**150+** companies already with us
