Shaped

Why ClickHouse for Analytics?

The problem wasn't storing data. It was querying it fast enough.

The Problem

The product needed customer-facing analytics, but analytical queries have very different access patterns from normal application requests. Using the same database for everything can become increasingly difficult as analytical queries grow more complex.

The Constraint

Fast Queries

Large Analytical Workloads

Operational Reliability

Responsive enough for customer-facing product views.

Able to scan and aggregate growing event volumes.

Without putting the core application workload at risk.

  • Fast QueriesResponsive enough for customer-facing product views.
  • Large Analytical WorkloadsAble to scan and aggregate growing event volumes.
  • Operational ReliabilityWithout putting the core application workload at risk.

The Options

Keep everything in MySQL

Not Chosen

Build custom aggregation layers

Not Chosen

Separate analytics with ClickHouse

Chosen

Why we considered it

Benefit

Drawback

Decision Rationale

Why We Chose The Approach

The Result

Analytics workloads moved off the primary database, improving query performance without affecting operational traffic.

In Retrospect

If I were building this again, I'd evaluate the same decision around three questions:

  1. How quickly is analytics volume growing?
  2. How much operational complexity does another datastore introduce?
  3. Can simpler aggregation solve the problem first?