Skip to content
Fintech · Backend Platform

Replacing a payments core without stopping the payments

How we plan a staged migration from a straining monolith to an event-driven platform, when every transaction has to arrive exactly once.

Live payments overview with volume, authorisation rate and settlement status
Developer console showing payment endpoints, example responses and live request logs
Reconciliation queue that matches ledger entries against provider statements

The situation

Consider a B2B payments provider whose original monolith has carried the company for years. Volume keeps growing, month-end peaks now approach the limits of a single primary database, and every release has become a coordinated, out-of-hours event.

A rewrite that stops feature work for a year is not an option, and neither is a maintenance window. Customers run payroll and supplier payments through the platform at all hours.

The challenge

Exactly-once money movement

Network retries and partial failures can never result in a payment being lost or applied twice.

No downtime budget

Traffic must shift gradually, with an immediate way back at each stage.

A data model full of history

Years of business rules live in stored procedures that nobody has fully documented.

The approach

  1. 1

    Map and instrumentWeeks 1–4

    Trace real transaction paths, record the undocumented rules and add the measurements needed to compare old and new behaviour.

  2. 2

    Build the ledger and backboneWeeks 5–12

    Introduce a double-entry ledger and Kafka backbone alongside the monolith, using idempotency keys on every write.

  3. 3

    Shadow and reconcileWeeks 13–18

    Mirror production traffic to the new services and reconcile every result against the monolith until differences are explained.

  4. 4

    Gradual cutoverWeeks 19–24

    Move customers across in small cohorts behind routing controls, with automatic rollback tied to error budgets.

Key decisions and trade-offs

Strangle the monolith instead of rewriting it

Why: Value arrives early and risk stays contained to one domain at a time.

Trade-off: Two systems run side by side for months, which adds temporary complexity.

Treat the ledger as the source of truth

Why: Double-entry accounting makes errors detectable by design and simplifies audit.

Trade-off: Every product flow has to be remodeled in ledger terms.

Keep PostgreSQL rather than adopt a new database

Why: The team already operates it well, and partitioning meets the projected load.

Trade-off: A future step-change in volume may require revisiting this.

How success is measured

MeasureBaselineTargetHow it’s measured
Peak throughputLimited by primary database4× current peakLoad test against production-shaped traffic
AvailabilityUnmeasured99.95% objectiveSLO dashboards on successful authorisations
Authorisation latencyVaries at peak<250ms at p95Distributed tracing
Reconciliation breaksInvestigated by hand0 unexplained each dayAutomated daily ledger reconciliation

Key takeaways

  • Shadow traffic finds the undocumented rules that interviews never will.
  • Decide what "correct" means in numbers before migrating a single customer.
  • Rollback has to be rehearsed, not just designed.
Next case studyDesigning a telehealth app patients can use on a bad connection

Facing something similar?

Book a free consultation. We’ll scope your project, pressure-test the plan and give you an honest estimate, with no commitment required.