ClickHouse vs Elasticsearch for logs and analytics: which one to run
Two engines that both get asked to hold logs and answer questions about them. What each one is built for, where each gets awkward, how their bills are metered and what running either of them involves. Checked 4 Dec 2026.
45 minutes with an engineer: we review your workload and sketch the design.
- ✓OSStend is our service
- ✓Checked 4 Dec 2026
- ✓No benchmarks quoted
ClickHouse is a column-oriented SQL database built for analytics over large tables, and Elasticsearch is a Lucene-based search engine built for text search and relevance. For logs and metrics at volume with aggregation-heavy questions, ClickHouse is usually the closer fit; for free-text search, relevance ranking and the Elastic solutions built on it, Elasticsearch is. Many estates run both. Checked 4 Dec 2026.
Customers
Partners
- PostgreSQL
- MySQL
- MongoDB
- Redis
Valkey
- OpenSearch
- Kafka
- RabbitMQ
- AWS
- Google Cloud
- Azure
- Kubernetes
- OpenShift
- Prometheus
- Grafana
- Datadog
- Dynatrace
- Splunk
Should I use ClickHouse or Elasticsearch?
Choose ClickHouse when the main job is SQL aggregation over large, append-heavy tables, such as product analytics, metrics and log statistics. Choose Elasticsearch when the main job is searching text, ranking results by relevance or running Elastic's search, observability and security products. If you need both, run both.
| If your main job is... | Start with | Why |
|---|---|---|
| Dashboards and aggregations over billions of rows | ClickHouse | ClickHouse describes itself as a column-oriented SQL database for analytics (ClickHouse docs, checked 4 Dec 2026) |
| Searching text and ranking results | Elasticsearch | Built on Lucene's inverted index and listed with lexical (BM25) and semantic search (Elastic pricing, checked 4 Dec 2026) |
| Application search with typo tolerance and facets | Elasticsearch | Search relevance is its core use. Check whether ClickHouse's text index covers your ranking needs. |
| Log storage cost and long retention | Test both | Both have storage-saving modes; results depend on your data. We quote no benchmark. |
| Security analytics inside Elastic's SIEM | Elasticsearch | Elastic's Security solution is built on it. |
| Frequent row-level updates | Neither | Both are awkward for it; see the write section. A transactional database such as PostgreSQL is the usual home. |
How we compared: each vendor's own docs and pricing pages, read on 4 Dec 2026, linked beside each fact. We ran no benchmarks and quote none. OSStend is our service and runs both engines, so read the verdicts as one vendor's view.
How do ClickHouse and Elasticsearch store and query data differently?
ClickHouse stores each column separately and is queried with SQL, which suits scanning a few columns across many rows. Elasticsearch stores JSON documents in Lucene indices with an inverted index, which suits finding documents by their words. The model decides which questions are cheap.
| ClickHouse | Elasticsearch | |
|---|---|---|
| What it is | Column-oriented SQL DBMS for OLAP (docs) | Distributed search and analytics engine on Lucene |
| Query language | SQL: GROUP BY, JOIN, window functions, subqueries | Query DSL, plus ES|QL on Elastic's tiers |
| Data unit | Rows in tables, ordered by a primary key | JSON documents in indices split into shards |
| Text search | Text (inverted) index, generally available from 26.2 (docs) | Inverted index by design, BM25 and vector search |
| Visibility of new data | After an insert completes; batch your inserts | Near real time, within 1 second by default (Elastic docs) |
| Licence | Apache 2.0 (licence) | ELv2, SSPL, and AGPL as an added option (Elastic) |
Sources linked in each cell, checked 4 Dec 2026. Elasticsearch's default refresh is every second, and only on indices that received a search request in the last 30 seconds (Elastic docs). Elastic's query DSL and ES|QL are described on its Cloud tier list (Hosted pricing).
Which is better for logs and observability?
For logs, the choice is between asking aggregate questions in SQL and searching for words with Elastic's tools around it. ClickHouse suits counting, grouping and percentiles over very large volumes. Elasticsearch suits a team that wants free-text search, Kibana and Elastic's observability products out of the box.
Elasticsearch has a dedicated storage mode for logs. Elastic says logsdb index mode cut log storage by up to 60% in its benchmarks, with a 10% to 20% hit to indexing performance, that results vary with your data and version, and that logsdb is the default for new logs data streams from Elastic Stack 9.0 (Elastic docs, checked 4 Dec 2026). That is Elastic's own result on its own data, and we repeat it as a claim to test, not a finding.
ClickHouse stores columns compressed and ClickHouse says analytical data often compresses around 10 times (ClickHouse pricing, checked 4 Dec 2026). Its inserts must be batched, at 1,000 rows or more and ideally 10,000 to 100,000, about one insert a second (ClickHouse docs, checked 4 Dec 2026), so a log shipper that sends events one at a time needs a buffer or asynchronous inserts in front of it. Our view: the decision usually turns on who reads the logs. Engineers who write SQL and want aggregates lean to ClickHouse, and teams that search by phrase in Kibana lean to Elasticsearch.
- ✓Take a week of your real logs, load them into both, and run the ten queries your team runs most.
- ✓Measure storage after merges or force-merge, not at ingest time.
- ✓Count the shipper work: batching for ClickHouse, index templates and lifecycle for Elasticsearch.
- ✓Price the result with each vendor's metering basis; see the bills section below.
Can ClickHouse replace Elasticsearch for full-text search?
For some workloads, yes. ClickHouse documents a text index, also called an inverted index, that maps tokens to row numbers, and it is generally available from version 26.2. For relevance ranking, fuzzy matching and the Elastic ecosystem, check your requirements one by one before you assume it can.
ClickHouse describes its text index as a mapping from tokens to the rows that contain them, built through tokenization, and recommends version 26.2 or later for production use (ClickHouse docs, checked 4 Dec 2026). That covers finding rows that contain given words. Elastic lists BM25 lexical search, semantic and vector search, hybrid search and rerankers across its tiers (Elastic pricing, checked 4 Dec 2026). The ClickHouse page we read does not claim relevance scoring, so if your product ranks results by relevance, treat that as a requirement to verify, not assume.
- Good fit for ClickHouse
- filtering and counting log lines that contain a token, with the result shaped by SQL.
- Good fit for Elasticsearch
- a search box where ranking, suggestions and language analysis matter to users.
- Test first
- phrase queries, stemming for your languages and the latency you need on a cold index.
If your question is Elasticsearch against its open-source fork, that is a different pair: see OpenSearch vs Elasticsearch.
How do inserts, updates and deletes compare?
Both are built for data that is written once and read many times. ClickHouse wants batched inserts and treats ALTER UPDATE as a heavy mutation not meant for frequent use. Elasticsearch accepts single documents, makes them searchable within a second, and re-indexes a whole document on update.
| Operation | ClickHouse | Elasticsearch |
|---|---|---|
| Insert | Batch at 1,000 rows or more, ideally 10,000 to 100,000; about one insert a second; async inserts shift batching to the server (docs) | Single documents or the bulk API; refresh makes them searchable within about 1 second |
| Update | ALTER TABLE ... UPDATE is a mutation; ClickHouse calls it a heavy operation not designed for frequent use (docs) | The update API gets the document, runs the change and re-indexes the whole document (API docs) |
| Delete | Lightweight DELETE exists for MergeTree tables; the ALTER ... DELETE form is heavyweight (docs) | Delete by document or by query |
| Best pattern | Append, then expire old data by partition or TTL | Append-only time series in data streams that roll over (docs) |
Sources linked in each cell, checked 4 Dec 2026, plus the near-real-time model in Elastic's docs. We did not benchmark either. If your data changes row by row, a transactional database is usually the better source of truth, with ClickHouse or Elasticsearch fed from it by change data capture.
How do the bills compare?
The metering bases differ, which matters more than the unit prices. ClickHouse Cloud meters storage on compressed data and compute by the unit-hour. Elastic Serverless meters ingest and retention on the uncompressed, normalized, enriched volume, while Elastic Hosted bills the resources you size.
| ClickHouse Cloud | Elastic Cloud | |
|---|---|---|
| Compute | Per compute-unit hour (8 GiB RAM, 2 vCPU): $0.2181, $0.2985 or $0.3903 by plan | Hosted: resource based. Serverless: as low as $0.14 ingest, $0.09 search, $0.07 ML per VCU-hour |
| Storage | $25.30 per TB-month on compressed data | Serverless: as low as $0.047 per GB retained a month, on uncompressed normalized volume |
| Support | Not listed on the pricing page we read | Tier-based on Hosted; 5%, 10% or 15% of Serverless spend |
| Idle | Compute scales to zero when idle | Serverless keeps a baseline of search resources, idle billed at a reduced rate |
Sources: ClickHouse pricing and Elastic Serverless pricing, checked 4 Dec 2026. 1 TB at $25.30 is $0.0253 per GB-month against Elastic's $0.047 per GB-month, but the two meter different byte counts, so the rates cannot be compared directly. Full line-by-line costs are in ClickHouse Cloud pricing and Elastic Cloud pricing.
What does running each one yourself involve?
Both are real operating work. ClickHouse needs batching, merge and part monitoring, replicas and ClickHouse Keeper. Elasticsearch needs shard sizing, heap and disk watermarks, snapshots and rolling upgrades. Elastic advises 10 GB to 50 GB per shard, ClickHouse about one insert a second.
| Area | ClickHouse | Elasticsearch |
|---|---|---|
| Capacity limits | Parts and merges: too many small inserts back up merging | Shards: aim for 10 GB to 50 GB and under 200 million documents each (Elastic docs) |
| Coordination | ClickHouse Keeper for replicated tables | Master-eligible nodes |
| Backups | BACKUP and RESTORE to object storage | Snapshots to a repository |
| Upgrades | Version line choice, rolling restarts | Rolling upgrades, with 8.x to 9.x planning |
| Where OSStend runs it | Managed ClickHouse | Elasticsearch as a service |
OSStend engineers run both engines 24/7 in our cloud, your cloud account, your data center, on Kubernetes or OpenShift, or air-gapped. Each design is written and signed off first, a failover is rehearsed before go-live, and pricing is quoted per design on pricing.
Who should skip this comparison, and who should pick which?
If your data changes row by row or you need transactions, neither is the first choice. If you run Elastic's own Security or Observability solutions, staying on Elasticsearch is the lower-risk path. If your questions are SQL aggregations over large append-only tables, ClickHouse deserves a trial.
Contact us if
- ✓You query billions of log or event rows with GROUP BY and want SQL, so run a ClickHouse trial.
- ✓You need a search box with relevance ranking and facets, so run Elasticsearch.
- ✓You want to keep Elasticsearch for search and add ClickHouse for the heavy analytics.
- ✓You must keep data in your own account or data center under a written design.
Not a fit if
- ✕You rely on Elastic's paid features or its Security and Observability solutions: staying on Elastic is simpler.
- ✕You need row-level updates and transactions: use a transactional database.
- ✕You expect a drop-in swap: queries, dashboards and shippers all change.
- ✕You want a benchmark winner: we publish none, and results depend on your data.
ClickHouse vs Elasticsearch questions
Is ClickHouse faster than Elasticsearch?
It depends on the query. ClickHouse describes itself as built for analytical aggregation over large tables; Elasticsearch is built for finding documents by text. We publish no benchmark, so test your own queries on both before deciding.
Can ClickHouse replace Elasticsearch for logs?
Often, for aggregate questions over logs, because ClickHouse is an analytics database with SQL and a text index available from 26.2 (docs, checked 4 Dec 2026). It replaces less well where teams depend on Kibana, relevance ranking or Elastic's Security and Observability products.
Is ClickHouse cheaper than Elasticsearch?
Not as a rule. The two bills meter different byte counts: ClickHouse bills compressed storage, while Elastic Serverless meters uncompressed, normalized volume. Price your own data on each vendor's calculator, then add the people cost of running it.
Is ClickHouse a search engine?
No. ClickHouse documents itself as a column-oriented SQL database for analytics. It has a text index for finding rows by token, which covers some search needs, but it is not built around relevance ranking the way Elasticsearch is.
Can I run both ClickHouse and Elasticsearch?
Yes, and many teams do: Elasticsearch for search and short-retention troubleshooting, ClickHouse for long-retention analytics, both fed from the same stream. The cost is two systems to operate, which a managed service can carry for you.
Are both open source?
ClickHouse is under the Apache License 2.0 (licence, checked 4 Dec 2026). Elasticsearch is offered under ELv2 and SSPL, and Elastic announced AGPL as a further option (Elastic). The details are in Elasticsearch as a service.
Related pages
- ComparisonElasticsearch vs OpenSearch in 2026: which to runElasticsearch vs OpenSearch in 2026: licence, vector search, migration and when each is the better choice. Sourced and dated, by a team that runs OpenSearch.
- ComparisonClickHouse Cloud pricing explained (2026)ClickHouse Cloud pricing from ClickHouse's own page: compute units, storage, backups and egress by plan, worked monthly examples and what self-managed costs.
- ComparisonElastic Cloud pricing explained (2026)Elastic Cloud pricing from elastic.co: Hosted tiers, Serverless unit rates, support as a share of the bill, worked examples and self-managed costs.
- ClickHouseManaged ClickHouse service, run in your cloudManaged ClickHouse: dedicated clusters with replication, ClickHouse Keeper, backups, storage tiers and LTS upgrades run 24/7 in OSStend's cloud, your cloud account or your data center.
- ElasticsearchElasticsearch as a service, in your cloud or oursElasticsearch as a service under the AGPLv3 option: masters, watermarks, snapshots and upgrades run 24/7 in our cloud, your cloud account or your data center.
- PricingDatabase as a service pricing: dedicated, tailoredDatabase as a service pricing from OSStend: dedicated, tailored clusters priced by engine, size, SLA tier and location. Enterprise only, with no free tier.
Get a design for ClickHouse, Elasticsearch or both
Bring your data volumes and the queries you run most. An engineer reviews them, writes a design and quotes that design, run 24/7 where you choose.
- ✓A design sketch for your workload, not a plan menu
- ✓A zero-downtime cutover path for what you run today
- ✓A price for that design, after the review





