Skip to content
Nodeyra.
SaaSBackend & cloudBilling

Rebuilding tenancy and billing without a migration weekend.

Replacing single-tenant assumptions and hand-rolled invoicing in a live product, incrementally, with no scheduled downtime.

Concept preview, sample data: a tenancy and billing admin listing tenants and plans, with an invoice reproduced from the event log
CLIENT
B2B SaaS platform, Australia
INDUSTRY
SaaS
WHAT WE DELIVERED
Build
TECHNOLOGIES
TypeScript · Node.js · PostgreSQL · Stripe · Temporal
DURATION
18 weeks
  • 0Hours of scheduled downtime
  • 27Tables migrated, each independently reversible
  • 100%Of invoices reproducible from the event log
  • 4Enterprise security reviews passed since

The challenge

The product had grown from a single-customer deployment into a multi-customer platform without the data model catching up. Tenant separation was enforced in application code rather than at the database boundary, and invoicing was a monthly script that had begun to require manual correction.

The product was live and could not take scheduled downtime, existing customers were on bespoke pricing that had to be preserved exactly, and enterprise prospects were asking security questions the team could not answer well.

Our approach

  1. STEP 1 · DISCOVERY

    Audited every query path

    Produced a map of where tenant scoping was missing, which turned an open-ended risk into a finite list of 27 tables.

  2. STEP 2 · FOUNDATIONS

    Moved isolation into the database

    Row-level security in Postgres, proven in staging before the application-level checks were removed.

  3. STEP 3 · MIGRATION

    Migrated table by table behind flags

    Dual-write and shadow reads made each step independently reversible. Billing moved to an event-sourced service, replayed against twelve months of past invoices before switchover.

  4. STEP 4 · HANDOVER

    Modelled legacy pricing explicitly

    Grandfathered plans rather than special cases in code, documented for the customer's own engineers.

Before and after

BEFORETenant isolation enforced by developer disciplineA monthly invoicing script needing manual correctionOne shared database with inconsistent tenant identifiersSecurity questions the team could not answer
AFTERIsolation enforced by database policy, demonstrable in reviewInvoices reproducible from the event logCutover with no scheduled downtimeStripe webhooks that tolerate retries and reordering

The outcome

The platform has since passed four enterprise security reviews, billing questions are answered by replaying the log rather than by inspection, and the cutover completed without a single customer noticing. Dual-write plus shadow reads roughly doubles the work of each step, but it is what let a live platform change its isolation model without a migration weekend.

We changed how tenancy and billing work underneath a live product and not one customer noticed. Security reviews are now something we pass, not dread.
Aisha ThorntonSeattle, USA
Concept preview, sample data: a payment operations screen listing transactions by status, with each core service marked as migrated, in cohort rollout or still on the existing systemNext story · Illustrative project · FintechA phased approach to payment platform modernisation.Read next →
Facing something similar?

Tell us about your system and we’ll give you an honest read on where to start.

Book an introductory call