Dockyard

Fintech / Payments ops

Ledgerline

40M transactions/day. 6hr close cut to 40 min.

Ledgerline reconciles payments for mid-market lenders. Their month-end close had grown into a six-hour nightly batch that failed often enough to need a person watching it, and the people watching it were the people who had built it.

We replaced the batch with an event-sourced ledger that reconciles continuously, and handed the team the runbook for it. This page is a placeholder write-up on a real template — the numbers below are illustrative until the engagement is cleared for publication.

What the batch actually cost

The six hours were not the problem. The problem was that a failure at 03:00 meant the close did not happen, and nobody knew until someone opened a dashboard at 08:00.

StageBeforeAfter
Nightly close4h 10m90s
Manual corrections31/mo0
Overnight pages11/mo0
Engineers who can run it13
Table 01 — Reconciliation, before and after the rebuild.

Deploy frequency followed

Once the close stopped being an event, releases stopped being scheduled around it. Both series below are drawn on one Y scale, so the change is not flattered by the axis.

Deploys per week

1deploys

W6

W1W2W3W4W5W6
Fig. 01 — Deploy frequency. Both series share one Y scale.
View data
SeriesLabelValue
BeforeW11 deploys
BeforeW20 deploys
BeforeW32 deploys
BeforeW41 deploys
BeforeW50 deploys
BeforeW61 deploys
AfterW14 deploys
AfterW29 deploys
AfterW311 deploys
AfterW414 deploys
AfterW512 deploys
AfterW617 deploys

The shape of the ledger

Every movement is an append-only event. Balances are a fold over that log, so a replay is a read rather than a repair.

balance_at.sql
-- Balance is a fold, never a stored mutable number.
SELECT account_id,
       SUM(amount) FILTER (WHERE posted_at <= $1) AS balance
FROM ledger_events
WHERE account_id = $2
GROUP BY account_id;
Fig. 02 — The reconciliation path.

Handover

Three of their engineers ran the system in production before we left, each taking one on-call rotation with us on standby and not called.

They turned up with a written plan on day four and never revised the date. The handover was a repo our team could actually read.