Skip to content
mentoor

Topic 4 of 5 · 5 min read

Choosing an analytics engine for a workload

Goal: Pick an analytics engine for a described workload and justify it with data size, user count and freshness needs.

Choose the simplest engine that meets four numbers: how much data, how many people query at once, how fresh the data must be, and what you can pay and operate. Most teams reach for a big warehouse earlier than they need to.

Check yourself · 1 of 3

Which set of facts do you need first to choose an analytics engine?

Choose one answer

Why it matters

An engine that is too small makes dashboards crawl. One that is too large costs money every month and adds a system to run. An assistant will happily recommend whatever it saw most in its training data, so you need your own criteria.

How to do it

  1. Write down the workload. Data size now and in a year, rows added per day, number of dashboard users, longest acceptable query time, and how old the data may be.
  2. Start from the smallest option. PostgreSQL with a read replica or a summary table handles a surprising range of reporting when data is in the tens of gigabytes and few people query it. Past that, scans start to hurt.
  3. Match each engine to its sweet spot.
    • DuckDB: one analyst or one batch job, files on disk or object storage, no server. Weak for many concurrent users.
    • ClickHouse: very fast scans and aggregation on large event data with many concurrent dashboard queries, fresh within seconds. You run it yourself or use its cloud service, and joins and updates need design care.
    • BigQuery and Snowflake: managed warehouses that scale with no servers to run, many users, mixed workloads. You pay for usage, so a careless SELECT * costs money.
  4. Test with your own data. Load one real table and run your three slowest queries. Vendor benchmarks use their own data.
  5. Write the decision down with the numbers, so you can revisit it when they change.

Before and after

Weak: "We need a data warehouse, so use Snowflake." Better: "40 GB of orders, 5 dashboard users, data may be a day old. A nightly export to Parquet queried with DuckDB, or a summary table in PostgreSQL, meets this. Revisit at 1 TB or 50 users."

What goes wrong

  • Resume-driven choice. A cluster for 20 GB adds operations work and cost with no speed gain for users.
  • Ignoring freshness. A nightly batch engine fails a request for "orders in the last minute".
  • Ignoring concurrency. An embedded engine that is fast for one analyst can stall under 40 dashboard viewers.
  • Ignoring cost models. Pay-per-scan pricing punishes unbounded queries; flat-capacity pricing punishes idle clusters.

Examples

Product analytics at 3 billion events

A web app adds about 30 million events a day. 60 people open dashboards through the day and want data less than a minute old. That points to ClickHouse or a managed warehouse with streaming ingestion, not DuckDB (concurrency) and not PostgreSQL (scan size).

Monthly board report

One analyst builds a report from 15 GB of exported orders, once a month, with a day-old tolerance. DuckDB over Parquet files meets it for no running cost. A warehouse here is spending for capacity nobody uses.

Key points

  • Decide from four numbers: data size, concurrent users, freshness and cost to run.
  • Plain PostgreSQL with a replica or summary tables covers many small reporting workloads.
  • DuckDB suits one analyst or batch job on files; it is not a server for many users.
  • ClickHouse suits large event data with many concurrent queries and second-level freshness.
  • Managed warehouses remove operations but charge for use, so unbounded scans become a cost problem.

Common mistakes

  • Choosing a warehouse by popularity instead of the four workload numbers.
  • Benchmarking with a vendor's sample data instead of your own slowest queries.
  • Forgetting that freshness and concurrency requirements can rule an engine out.
  • Not setting query limits on pay-per-scan engines.

Check yourself · 2 of 3

One analyst builds a monthly report from 15 GB of exported files, and day-old data is fine. Which fits best?

Choose one answer

Check yourself · 3 of 3

60 people open dashboards over 3 billion events and need data under a minute old. Why is DuckDB over files a poor fit?

Choose one answer

Practice items, not counted towards your mastery.

Start here