Microservices are a scaling tool, not a default architecture.
We split NestJS apps when teams, deploy cadence, or failure domains genuinely diverge — not because a diagram looks cleaner.
Production upgrades rarely fail because of framework bugs — they fail when cache assumptions, auth cookies, and CDN headers were never validated together on staging that mirrors real traffic shape.
Before committing to a migration window, align product, infrastructure, and support on rollback criteria. A written go/no-go checklist prevents heroics when metrics drift after deploy.
Redis-backed Bull queues handle async work that should never block HTTP responses: email, webhooks, report generation.
Each worker gets its own container with constrained memory so a poison job cannot take down the API tier.
Inventory every data fetch path: server components, route handlers, and client-side SWR hooks. Tag each call with expected staleness and document who owns invalidation when upstream data changes.
Middleware and edge handlers deserve the same regression suite as API routes — especially redirects, locale detection, and auth gates that behave differently under bot traffic.
Shared contracts live in a versioned package — DTOs, event schemas, and
OpenAPI stubs — so services do not drift silently across repos.
Partial prerendering and streaming change how users perceive performance. Measure first meaningful paint separately from time-to-interactive on routes that mix static shells with dynamic holes.
Document boundary decisions in ADRs so the next squad does not collapse dynamic regions back into fully static pages for short-term convenience.
Our Docker Compose layout separates API, workers, and Redis with explicit health checks.
Deploys stay boring — and that is the point.
Staging must replay CDN cache keys, not only origin responses. We clone production cache headers and run synthetic crawls before promoting framework upgrades.
Load tests should include authenticated sessions and cart mutations — anonymous homepage tests alone miss the routes that break under cache policy changes.
When incidents happen, bounded contexts with clear ownership shorten
mean time to resolution more than any orchestration dashboard.
Dashboard cache hit ratio, RSC payload size by route, and error rate per layout segment on one screen. On-call should not hunt across three tools during an incident.
Schedule a 48-hour post-upgrade review with engineering and client stakeholders — capture what surprised you while context is fresh.
The table below summarizes the reference points we review with client stakeholders before sign-off. Use it as a shared vocabulary in sprint planning and release reviews.
Migration risk matrix
| Area | Risk level | Mitigation | Owner |
|---|---|---|---|
| Caching defaults | High | Audit fetch + revalidate usage | Platform |
| Dynamic routes | Medium | Staging parity with CDN headers | Web |
| Middleware | Medium | Edge-case test suite | Web |
| ISR pages | High | Load test under realistic traffic | SRE |
| Auth cookies | High | Cross-domain staging replay | Security |
| Observability | Medium | Dashboard per route segment | SRE |
Run through this checklist in order — skipping steps because of deadline pressure is how regressions reach production. Assign an owner for each item before you schedule a launch window.
Pre-launch gates
- Run regression suite on staging with production-like data volume.
- Validate observability dashboards and alert thresholds.
- Document rollback steps before promoting to production.
- Schedule a post-deploy review within 48 hours.
- Confirm cache headers and CDN behavior match the signed-off staging replay.
- Verify feature flags and kill switches for partial rollout paths.

