Skip to content
cd ../projects
SaaSLive in Production

Alpha SaaS Platform

Enterprise-grade ERP with real-time WebSocket capabilities

Kelhos Brand graphic titled SaaS platform case study: scaling a collapsing monolith

SaaS platform case study: scaling a collapsing monolith

This SaaS platform case study covers a fintech B2B product whose monolithic Node.js application was collapsing under load: P99 latency hitting 8.2 seconds, an error rate above 12%, and a cold-start problem that made auto-scaling effectively useless.

The fix was a move to a microservices, event-driven architecture: the monolith split into 12 domain services around bounded contexts, a Redis-backed event bus for real-time communication, and deployment on AWS ECS with predictive auto-scaling driven by custom CloudWatch metrics.

The result was a 4x increase in throughput, P99 latency down from 8.2 seconds to 48 milliseconds, server costs roughly halved, and uptime moving from 97.2% to a 99.99% SLA, verified under a load test of 1.2 million concurrent WebSocket connections.

The build ran over 24 weeks with a team of four engineers. The first two weeks covered an architecture audit, load profiling and a domain-driven design event-storming workshop to map the eventual service boundaries. Domain design and API contracts followed over weeks three to five, then nine weeks of parallel service development, CI/CD pipelines and the Redis event bus. Integration, security hardening and load testing at 1.5 million concurrent users filled the remaining weeks before a blue/green cut-over and 24-hour monitoring on go-live.

The stack itself was chosen for the specific failure modes this platform was hitting: Next.js and TypeScript on the frontend, Node.js services behind an AWS ECS and Fargate deployment, PostgreSQL, Redis and TimescaleDB for polyglot persistence per service, and Docker containers throughout for consistent builds across the pipeline. Nothing here was chosen for novelty; each piece maps directly to one of the four painpoints in the original audit.

A few details from the load-testing phase are worth calling out specifically, since they are the parts that actually got verified rather than assumed. The architecture sustained 1.2 million concurrent WebSocket connections in a dedicated load test, deployments moved to a zero-downtime blue/green model on ECS, data residency was kept compliant with GDPR across three AWS regions, and encryption at rest and in transit runs through AWS KMS with a custom key-rotation policy rather than the provider defaults.

None of this was a rewrite for its own sake. Every architectural decision traces back to one of the four numbers in the original audit, and the project was judged, throughout, against whether it moved those specific numbers rather than against how modern the resulting stack looked on paper.

See Core Web Vitals (web.dev) for the same latency and responsiveness measures this project was built to improve. Our web development and Facebook ads services cover the same kind of work described here.

Type

SaaS

Duration

6 months

Team Size

4 engineers

Industry

FinTech / B2B

Error Log

Scale to 1M+ Concurrent Users

The client's monolithic Node.js app was collapsing under load — P99 latency hitting 8 seconds, frequent OOM crashes, and a cold start problem that made auto-scaling useless.

8.2s
P99 Latency
12.4%
Error Rate
14s
Cold Start
$28k
Monthly Cost
Resolved

Microservices + Event-Driven Architecture

We decomposed the monolith into 12 domain services, introduced a Redis-backed event bus, and deployed on AWS ECS with predictive auto-scaling using custom CloudWatch metrics.

Domain Decomposition

12 micro-services via DDD bounded contexts

Polyglot Persistence

PostgreSQL + Redis + TimescaleDB per service

AWS ECS + Fargate

Predictive auto-scaling with custom metrics

WebSocket Gateway

Real-time pub/sub via Redis Streams

Build something like this

Ready to scale your product?

We engineer high-performance systems that grow with your ambitions.