B2B SaaS, 2024
Relay
A reporting rebuild that took an analytics product's slowest dashboard from 14 seconds to under one.
- Sector
- B2B SaaS
- Year
- 2024
- Duration
- 3 months
- Team
- 2 engineers
- Focus
- Performance
Architecture, 6 components
- Client
- Service
- Queue or log
- Data store
- External system
The problem
Customer dashboards ran aggregate queries across hundreds of millions of rows on every page load. Large accounts timed out, and support tickets about slow reports were the product's top churn signal.
What we built
- 01Profiled the twenty slowest queries against a production-sized copy of the data.
- 02Introduced incremental rollup tables maintained by a background worker.
- 03Added covering indexes that matched the real filter and sort order of each report.
- 04Cached hot report fragments with explicit, event-driven invalidation.
What changed.
- p95 dashboard load, from 14 s
- 0.8 s
- database CPU at peak
- −48%
- report timeouts in the last two quarters
- 0
Stack
- Node.js
- PostgreSQL
- Prisma
- Redis