alex.bilba·case study
Email direct@alexbilba.com
# case study · platform migration

Migrating a live B2B platform to serverless AWS
without betting the business.

BuildCore ran two backends at once. I designed and implemented the bridge to consolidate its data model while the existing production system stayed authoritative. I designed for zero downtime and reversibility. The engagement ended before I could confirm the final production read cutover.

← BuildCore flagship case study
rolesenior project manager · technical owner (architecture, planning, execution)timelineMay–July 2026 · ~3 months end to endstatusmigration implemented · final production read cutover unconfirmedstackTypeScript · AWS (Lambda/DynamoDB/API Gateway/Cognito) · Redshift Serverless · CDKfromSupabase / Postgres → serverless AWS
<$45/mo
infra · 3 AWS accounts
1
engineer on the migration · AI-assisted
~8,150
backend tests · coverage floors + ratchets
~25
DynamoDB tables mirrored
15+
entity types migrated
~50
write paths, mechanically derived
8
soak windows validated
40+
PRs/week · 3 repos
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# the problem

Two backends, two data models.

A B2B construction-management platform was running two backends at once — an inherited Supabase/Postgres staff portal and a purpose-built AWS customer portal. Not a crisis; a convergence problem. Every cross-portal feature got built twice, entities lived in two shapes, the two systems handled access differently, and each release added maintenance.

# before · divergence
  [ staff portal ]     ──▸  [ supabase · postgres ]   ◂─ inherited stack
  [ customer portal ]  ──▸  [ aws · dynamodb ]        ◂─ purpose-built

  two data models · every cross-portal feature built twice or bridged
two systems of record · different access models
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# the decision that didn't go as recommended

We overrode the safe recommendation.

The strategy analysis recommended Aurora Postgres as the system of record. We went the other way — an all-in port to DynamoDB with a dual-write bridge.

recommendedchosen
pathAurora Postgres as system of recordall-in port to DynamoDB + dual-write bridge
data modelkeeps the older of the twothe one the customer portal already used
posturea managed database to runserverless · no standing capacity
risklower short-term variancehigher up front · reversible at every step
end statepreserves the split that caused itone data model
  • Customer portal was born native on DynamoDB — Aurora meant migrating proven infra backward.
  • DynamoDB scaling + latency fit the access patterns.
  • Serverless posture: no standing capacity to pay for or operate.
  • Reversibility made the higher-variance choice defensible — being wrong was a toggle, not an outage.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# three constraints that shaped everything

What the design had to survive.

01Live production, field usersSupabase stayed authoritative the whole time — every write kept landing in the system of record. The business never bet on the new stack.
02Money-path exactnessInvoices, draws, and payment schedules run on integer-cent arithmetic, fail-loud. One penny of divergence between stores fails a gate — not a warning.
03Migration ownershipI led the migration implementation. Derived manifests, drift-guarded gates, and automated verification supported the validation work.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# what I built to make it safe

Validation before switching reads.

# the dual-write bridge
  [ portal write ] ──▸ [ supabase · postgres ] ◂── system of record
                              │
                              └─▸ [ dual-write fan-out ] ──▸ [ dynamodb ]
                                        │                         │
                                  carries incumbent id            ├─▸ shadow compare
                                                                  │     (field by field)
                                                                  ├─▸ read path
                                                                  │     (flag-gated per entity/org)
                                                                  └─▸ [ zero-ETL ] ▸ [ redshift ]
supabase authoritative throughout · dynamo mirrored + shadow-compared · reads flip per entity behind a flag
Dual-write fan-outEvery Supabase write mirrors to DynamoDB — flag-gated per entity/org, carrying the incumbent ID. Fails open; a mirror hiccup never breaks the portal.
Shadow compareReads hit both stores and compare field by field. Divergences log as structured events, never shown to users.
Soak gatingReads can’t flip until a soak window exercises every write path clean. Manifest is derived from the TypeScript by call-graph analysis and drift-guarded. Gates emit signed receipts.
Instant reversalOne command flips reads per entity. Writes stay dual, so reversal is lossless and immediate — a toggle, not a restore.
Risk-scaled reviewEvery PR auto-reviewed to a terminal state; migration-surface PRs get an adversarial verification pass before merge.
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# when the machinery earned its cost — continuously

Defects surfaced throughout, not once.

Shadow compare and soak validation ran continuously and surfaced defects throughout — divergences, missed cascades, status drift, write-path edge cases unit tests didn't reach. Most were caught and fixed inside the same soak window. One shows the shape of it:

divergencescopeStatus: primary said ARCHIVED, mirror said SCHEDULED — one field, one row.
causeArchiving a project cascade-archived its scopes and work orders in the primary DB; the cascade never wrote to the mirror.
if shippedEvery archived project's scopes and work orders reappear as open, scheduled work — cancelled jobs field teams could act on.
caught byThe first soak window to exercise the archive path — a path the mechanically-derived manifest had just picked up. Fix cost nothing in validation.

That's the whole argument for the approach: the alternative is discovering it in production, on money-adjacent data, without a validated rollback path.

The Tier-B warehouse: 8 deploy attempts, one error mask.

Zero-ETL replication from DynamoDB to Redshift Serverless failed repeatedly with what looked like a single AWS error. It was two stacked root causes wearing the same mask:

  • a split across two policy stores;
  • an IAM ARN service-prefix mismatch underneath it.

Each fix revealed the next, identically — written up as a root-cause ledger. The instructive failure mode: an identical error across attempts read as one unsolved problem, not two sequential ones.

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# results

What it came to.

0115+ entity types mirrored across ~25 DynamoDB tables
027 soak slices covering ~50 mechanically derived write paths, validated across 8 soak windows
03~8,150 backend tests with coverage floors and quality ratchets
04Under $45/month total infrastructure across three AWS accounts — no standing capacity, cost scales with usage
05~3 months end to end · designed for reversibility, validated through soak, cutover gated
0640+ PRs merged per week across three repositories using AI-assisted review
07Contract-first API design (Smithy / AWS PDK) with generated runtime types and documentation
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# what I'd take from it

The machinery was the consequence, not the flourish.

  • For this migration, derived manifests, drift guards, and gates that fail closed made validation repeatable while production stayed on its existing read path.
  • Overriding the recommended architecture only worked because every step was reversible. The higher-variance path was defensible precisely because being wrong was a toggle, not an outage.
← Back to BuildCore