Skip to content

Template demo: Arcline, its customers, people and figures are fictional.

Get this template
Back to blog
Engineering1 min read

How we query billions of events in under 100ms

A look inside the columnar storage, pre-aggregation and caching layers that keep Arcline fast at any scale.

Kofi MensahCo-founder & CTO

Arcline processes more than three billion events every month, and our customers expect every chart to load instantly. Here's how our query engine keeps p95 latency under 100 milliseconds.

Columnar storage

Events are stored in a columnar format partitioned by workspace and day. Most queries touch a handful of columns, so we read a fraction of the bytes a row store would.

Smart pre-aggregation

We continuously roll up popular metrics at hourly and daily granularity. When you open a dashboard, most charts are served from these rollups and only the freshest minutes are computed on the fly.

-- Simplified rollup query
SELECT workspace_id, toStartOfHour(ts) AS hour,
       event, uniqExact(user_id) AS users
FROM events
GROUP BY workspace_id, hour, event;

Edge caching

Query results are cached at the edge, keyed by the query fingerprint and data version. When new events arrive we invalidate only the affected time buckets.

  • #Infrastructure
  • #Performance

Written by

Kofi Mensah

Co-founder & CTO at Arcline

Ready to see your product clearly?

Join 12,000+ teams using Arcline to understand their users and grow faster. Set up in minutes.