Silo 02

Data Silo

A MySQL-backed analytics service that delivers stable reporting for operations and leadership dashboards.

Requirements

  • Refresh reporting tables every 15 minutes with bounded query cost.
  • Guarantee p95 report query latency below 500ms under normal load.
  • Preserve metric consistency across weekly operations reports.

Stack

  • Node.js
  • TypeScript
  • MySQL
  • Prisma
  • Nginx

Architecture

Workflow

  1. Workers pull source snapshots and stage them in landing tables.
  2. Normalization jobs map records into dimensional report schema.
  3. Pre-aggregation tasks materialize common KPI views.
  4. API serves read-only metric endpoints with cache hints and query guards.

Diagram

flowchart TD
      A[Source Systems] --> B[Landing Tables]
      B --> C[Normalization Workers]
      C --> D[MySQL Reporting Schema]
      D --> E[Pre-Aggregated Views]
      E --> F[Metrics API]
      F --> G[Operations Dashboard]

Tradeoffs

  • Additional storage used for pre-aggregations to improve read latency.
  • Slight freshness delay accepted to keep query performance predictable.
  • Schema evolution requires migration discipline across ingest and report layers.

Risks / Failure Modes

  • Unbounded ad-hoc query patterns can bypass performance controls.
  • Late-arriving source events can skew period aggregates.
  • Index drift can degrade dashboard response times over time.

Outcomes