case/experiences/sociax
06/08
Sociax·São Paulo, BR·Nov 2020 - Jun 2021

Full Stack Developer

I cut API latency from 3s to 200ms on a stakeholder dashboard.

3s → 200ms
latency at peak
consulting
3 parallel contracts
PJ
contract

One of three parallel consulting contracts at the time (with Bullla and WEX). A slow stakeholder dashboard was blocking the business I rewrote the backend from scratch.

01

Context

Stakeholder dashboard pulling Facebook API data for actionable analytics. One of three parallel consulting contracts I was running at the time (with Bullla and WEX), so the engineering had to be tight and self-explanatory.

02

Problem

Dashboard responding in 3s at peak. Backend was patchwork N+1 queries everywhere, no caching, no observability. Stakeholders avoided the tool because it was faster to ask via Slack.

3s → 200ms
latency at peak
03

Rewrite

Backend from scratch with Next.js on the front. Optimized queries, strategic cache (per-stakeholder + per-time-window), lean API layer that the dashboard could trust as a single source of truth.

04

Outcome

Latency dropped from 3s to 200ms at peak 15× faster. Dashboard shifted from 'avoided' to 'first place stakeholders open' for time-sensitive decisions.

decisions & tradeoffs
  • Why a backend rewrite instead of incremental fixes?
    Full rewriteThe patchwork had more accidental complexity than the domain. Rewriting was faster than untangling the N+1s, the missing cache layer and the absent observability one PR at a time.
  • Why Next.js on the front?
    Next.js + SSRStakeholders open the dashboard from email/Slack first-byte time matters more than rich client interactivity. SSR gave them the data on the first paint, not after a JS bundle parsed.

3s → 200ms. The dashboard became a real-time decision tool for stakeholders.