Skip to content

Case study 05 · Marketplace and revenue

Live analytics for advertisers at two million writes a day

I built the analytics layer of an advertising marketplace. Each customer's annual report came back in under a second, even for accounts with 900+ listings.

EngagementTechnical Lead · US marketplace for truck services · 2022–2026 · team of 12 · same engagementPublished

2M+ writes per day

into the time-series database

Annual report under one second at 900+ listings

reading 365 daily rollups per listing

The story in 5 steps

Stack

  • InfluxDB
  • MySQL
  • WebSockets
  • Node.js
  • AWS

01 · Context

I designed and built the analytics layer for an advertising marketplace.

High-volume writes, live reads and fast yearly reports normally exclude one another.

02 · Could not change

On an advertising platform, what a customer pays for is proof that their listing was seen.

The analytics are what justifies the invoice, which rules out buying an off-the-shelf tool.
The system had to take writes at volume, serve live reads and aggregate a whole year quickly, all at the same time.

03 · What I did

A time-series database for ingest, with a deliberately small index. I put identifiers such as listing, user and device into fields.

Keeping listing IDs out of the index meant the time-series store could not group by listing efficiently, so that grouping was done in the relational database.
Daily rollups in the relational databaseRaw events were kept for seven days, with a daily export to object storage as the archive.
Because of the rollups, the annual report never touched a raw row: it read 365 summarized rows per listing.

04 · Result

2M+ writes per day into the time-series database

Advertisers read their numbers live in the dashboard
Annual report under one second at 900+ listingsreading 365 daily rollups per listing
The same data feeds the yearly report sent before each renewal

05 · Differently

Seven days of raw retention was chosen early and never revisited.

Related services

The services that draw on this work.

Related writing

Posts that came out of this project.

Case study 05

Working on a similar problem? We reply within one business day.

The first call takes 30 minutes, and you’re under no obligation.

Tell us about your projectcontact@microtech.consulting