craigthompson.dev

$ cat case-studies/data.md

Making the flagship report fast at scale

// 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
  1. every response
  2. unwind all facets
  3. group everything
  4. confidentiality in the query
after: work moved to write time, reads stay lean
  1. facets denormalised on write
  2. purpose-built collection
  3. high-cardinality-first index
  4. analytics-node read
  5. 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
  1. streamed bulk operations
  2. reporting rework
  3. purpose-built collection
  4. 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.

$ ls case-studies/

Search and jump