← back to the sandbox
LeanQ · Dec 2022–Dec 2023NestJSMicroservicesTypeScriptZero-Downtime

Monolith → Microservices Migration

Role & context

At LeanQ, I spearheaded the migration of a legacy monolith to a NestJS microservices architecture, leading a cross-functional team of 6 engineers through the transition alongside the platform's day-to-day feature work.

The challenge

The existing monolith had held up to roughly 300 concurrent users, but was becoming the ceiling on further growth — deploys, scaling and fault isolation were all coupled to a single codebase and a single failure domain. The migration had to happen without downtime: 850+ legacy users were active on the system and couldn't be taken offline for the cutover.

Approach

I broke the monolith apart into NestJS + TypeScript services organized around domain boundaries, migrating incrementally rather than in one cutover — running old and new paths side by side and shifting traffic service by service so any regression stayed isolated and reversible. Test coverage was built up to 80% across the migrated services before each cutover step, specifically to catch behavioral regressions that a re-architecture like this is prone to introducing silently.

Tech stack

  • NestJS + TypeScript for the migrated services
  • Domain-boundary-based service decomposition
  • Automated test suite built to 80% coverage as a migration safety net

Results

  • Scaled the platform from 300 to 1,200+ concurrent users
  • Zero-downtime migration of 850+ legacy users onto the new architecture
  • 80% test coverage across the migrated services