// data & performance · 2021 → 2026
Making the flagship report fast at scale
Reporting is often the first place a SaaS platform slows down: large aggregations sliced by many dimensions at once. I led the redesign of a core reporting data model and its queries on MongoDB, and we proved the new version matched the old one in production before switching over.
before: work done at read time, on every request
- every response
- unwind all facets
- group everything
- confidentiality in the query
after: work moved to write time, reads stay lean
- facets denormalised on write
- purpose-built collection
- high-cardinality-first index
- analytics-node read
- confidentiality in code, cacheable
10×
higher complexity ceiling for core reports
1–3 s
search stalls removed from people lists under load
~8,000
records no longer loaded to open one dashboard
V1 ⇄ V2
diff mode proved parity in production
How it evolved: read-time work → write-time design
- streamed bulk operations
- reporting rework
- purpose-built collection
- Atlas Search
# in practice
- Large customers can slice results by far more demographics before hitting limits.
- Bulk operations on very large tenants stream records instead of loading them all into memory.
- Every environment, and every laptop, can restore a realistic “gold” dataset in one step.