The challenge
A B2B analytics SaaS had found product-market fit and was onboarding enterprise customers considerably larger than anything the platform had been designed for. A single large tenant running a heavy report could degrade response times for every other customer, and the team was fielding performance complaints weekly.
The internal assumption was that a rewrite onto a microservices architecture was needed. The engineering team had begun planning it, which would have consumed most of the following year at exactly the moment the commercial team needed feature velocity.
What we did
- 01
Measured before rebuilding
Three weeks of query-level profiling and distributed tracing showed that eleven query patterns accounted for 84% of database load, and that two tenants generated most of the contention. The rewrite was not the required fix.
- 02
Fixed the queries and the indexes
Targeted index work, query rewrites and pre-aggregated materialised views for the heaviest report patterns — a fraction of the effort of a rewrite, with most of the latency improvement.
- 03
Isolated tenant workloads
Heavy analytical work moved to a separate connection pool and worker tier with per-tenant concurrency limits, so no single customer can starve the others regardless of what they run.
- 04
Matured the delivery pipeline
Build caching, test parallelisation, preview environments per pull request and canary deployment with automated rollback took the release cycle from fortnightly and nervous to daily and routine.
- 05
Established SLOs and error budgets
Per-service objectives agreed with the commercial team, with burn-rate alerting replacing an alert set that had trained everyone to ignore it.
The outcome
p95 API latency dropped 78% and the platform absorbed 8x tenant growth over the following year on substantially the same architecture. The planned rewrite was cancelled, releasing roughly a year of engineering capacity back to product work.
Deployment frequency moved from fortnightly to daily, and change failure rate fell as batch sizes shrank. The engineering team now runs the SLO review cadence themselves.