Back to the guides

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

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. 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.

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

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.

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 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, 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, 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: 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 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 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
06.2512.518.7525billionAug · 20.01 billionAugSep · 19.63 billionSepOct · 20.7 billionOctNov · 20.47 billionNovDec · 21.63 billionDec
Show the data
CategoryTransactions (billion)
Aug20.01
Sep19.63
Oct20.7
Nov20.47
Dec21.63

Source: NPCI UPI product statistics (provisional monthly data), as reported by Business Today, Jan 2026. 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.


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, 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 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 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 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.
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), 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. Authorisation itself is covered in the FCA EMI licence 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 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 guide shows how the modules fit together.

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


FAQ

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Other Guides

Create a digital bank in a matter of days

Request demo
Companies using Crassula
150+ companies already with us
Top