Skip to content
All work

Case study 14 / 25Next.js Front-End

Full-stack performance engineering for a real-time monitoring platform

Replay at 10× now meets 98–99% of frame deadlines instead of none, with background database reads down from ~305 to ~10 a minute.

My roleDesigned it and led a team of up to 3: set its standards, mentored it, agreed the roadmap with operations and the client, presented to leadership.

Stack

  • React
  • Next.js
  • MUI
  • ECharts
  • CesiumJS
  • Service Workers
  • Node.js
  • InfluxDB

01 · How it works

  • TodaytoChanged in this work
  • Data flow

What it does

The monitoring platform combines a web client, an API and a 3D map service: users follow live profiles on a dashboard and replay history as a time-lapse. I ran an end-to-end performance audit across all three layers and kept a log of 31 measured findings.

Read more

25 shipped, 6 were rejected on evidence, and the platform now does work only when the data changes.

4 connections· select a part to trace it
  1. API (history) to Frame builder: returns history in batches
  2. Playback clock to Frame builder: fires each frame on its slot
  3. Frame builder to Profile charts: reused objects, one update
  4. Frame builder to Light per-frame tables: rows for the current frame

02Results

  • R01Higher is better

    Frames on time at 10× playback

    Before 0%, after 99%, from zero. Higher is better.
    Before
    After
  • R02Lower is better

    Main-view re-renders at rest, per 20 s

    Before 76, after 2, 38× lower. Lower is better.
    Before
    After
  • R03Lower is better

    JavaScript on the heaviest page

    Before 2,512 KB, after 1,762 KB, −30%. Lower is better.
    Before
    After

What it achieved

  • What users see when they replay history at 10×: no frame on time → 98–99% on time, a smooth time-lapse
  • Idle cost: continuous map repaints and re-renders → maps idle, 2 re-renders per 20 s
Read more
  • Database load: ~305 → ~10 background reads per minute
  • Engineering backlog: unmeasured opinions → 31 measured findings, 25 shipped, 6 rejected on evidence
  • JavaScript on the heaviest page: 2.51 MB → 1.76 MB (−30%)

03Decisions and trade-offs

  1. Constraint

    Sending only new data to the charts looked like the obvious fix.

    Decision

    Measure first: an update cost the same at any size; the cost was a highlight reapplied per point.

    What it cost

    The obvious fix was never shipped.

  2. Constraint

    The test machine drifted 2.4× between runs.

    Decision

    Compare operation counts instead of milliseconds.

    What it cost

    Results speak in counts, such as re-renders per 20 s, more than in time.

  3. Constraint

    Merging three chart libraries, removing glow series and rebuilding annotations less often all looked like wins.

    Decision

    Measure each before changing anything.

    What it cost

    All three were dropped on evidence; 25 of 31 findings shipped.

The challenge

The platform consumed resources when nothing was happening. At rest the main view re-rendered 76 times in 20 seconds, the 3D maps repainted continuously, and a map parked off-screen kept drawing and fetching. Underneath, a poller queried the database about 305 times a minute.

Read more

The time-lapse replay exposed the full cost: at 10× speed not a single frame met its deadline, because every step handed the charts new objects and they redrew from scratch. The task was to find the waste across three layers, prove each cause with a measurement, and remove it without changing anything users see.

What I learned

Measurement rewrote the plan. Each cause was proven with a measurement and removed without changing anything users see, across the web client, the API and the 3D map service, so the platform now works only when the data changes.

Read more

When the test machine itself drifted, operation counts replaced milliseconds. A performance audit is judged by the changes it rejects as much as by the ones it ships.

Stack

  • React
  • Next.js
  • MUI
  • ECharts
  • CesiumJS
  • Service Workers
  • Node.js
  • InfluxDB

Skills

  • Performance engineering
  • Full-stack profiling
  • Front-end architecture
  • Data visualization
  • Technical audits
Cover picture for Full-stack performance engineering for a real-time monitoring platformCover picture for Full-stack performance engineering for a real-time monitoring platform