title_wip

### Real-time analytics[​](#real-time-analytics "Direct link to Real-time analytics")

Based on public [benchmark](https://benchmark.clickhouse.com/#system=+%E2%98%81w%7C%EF%B8%8Fr%7CC%20c%7Cnfe&type=-&machine=-ca2%7Cgl%7C6ax%7C6ale%7C3al&cluster_size=-&opensource=-&tuned=+n&metric=hot&queries=-) data,
ClickHouse outperforms Snowflake for real-time analytics applications in the following areas:

- **Query latency**: Snowflake queries have a higher query latency even
  when clustering is applied to tables to optimize performance. In our
  testing, Snowflake requires over twice the compute to achieve equivalent
  ClickHouse performance on queries where a filter is applied that's part
  of the Snowflake clustering key or ClickHouse primary key. While
  Snowflake's [persistent query cache](https://docs.snowflake.com/en/user-guide/querying-persisted-results)
  offsets some of these latency challenges, this is ineffective in cases
  where the filter criteria are more diverse. This query cache effectiveness
  can be further impacted by changes to the underlying data, with cache
  entries invalidated when the table changes. While this isn't the case in
  the benchmark for our application, a real deployment would require the new,
  more recent data to be inserted. Note that ClickHouse's query cache is
  node specific and not [transactionally consistent](https://clickhouse.com/blog/introduction-to-the-clickhouse-query-cache-and-design),
  making it [better suited](https://clickhouse.com/blog/introduction-to-the-clickhouse-query-cache-and-design) 
  to real-time analytics. Users also have granular control over its use
  with the ability to control its use on a [per-query basis](/docs/operations/settings/settings#use_query_cache),
  its [precise size](/docs/operations/settings/settings#query_cache_max_size_in_bytes),
  whether a [query is cached](/docs/operations/settings/settings#enable_writes_to_query_cache)
  (limits on duration or required number of executions), and whether it's
  only [passively used](https://clickhouse.com/blog/introduction-to-the-clickhouse-query-cache-and-design#using-logs-and-settings).
- **Lower cost**: Snowflake warehouses can be configured to suspend after
  a period of query inactivity. Once suspended, charges aren't incurred.
  Practically, this inactivity check can [only be lowered to 60 s](https://docs.snowflake.com/en/sql-reference/sql/alter-warehouse).
  Warehouses will automatically resume, within several seconds, once a query
  is received. With Snowflake only charging for resources when a warehouse
  is under use, this behavior caters to workloads that often sit idle, like
  ad-hoc querying.

  However, many real-time analytics workloads require ongoing real-time data
  ingestion and frequent querying that doesn't benefit from idling (like
  customer-facing dashboards). This means warehouses must often be fully
  active and incurring charges. This negates the cost-benefit of idling as
  well as any performance advantage that may be associated with Snowflake's
  ability to resume a responsive state faster than alternatives. This active
  state requirement, when combined with ClickHouse Cloud's lower per-second
  cost for an active state, results in ClickHouse Cloud offering a
  significantly lower total cost for these kinds of workloads.
- **Predictable pricing of features:** Features such as materialized views
  and clustering (equivalent to ClickHouse's `ORDER BY`) are required to reach
  the highest levels of performance in real-time analytics use cases. These
  features incur additional charges in Snowflake, requiring not only a
  higher tier, which increases costs per credit by 1.5x, but also
  unpredictable background costs. For instance, materialized views incur a
  background maintenance cost, as does clustering, which is hard to predict
  prior to use. In contrast, these features incur no additional cost in
  ClickHouse Cloud, except additional CPU and memory usage at insert time,
  typically negligible outside of high insert workload use cases. We've
  observed in our benchmark that these differences, along with lower query
  latencies and higher compression, result in significantly lower costs with
  ClickHouse.

- [Comparison](#comparison)
  - [Similarities](#similarities)- [Differences](#differences)- [Real-time analytics](#real-time-analytics)

Was this page helpful?