TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

VictoriaLogs Beats Elasticsearch, MongoDB and PostgreSQL in ClickBench

13 点作者 valyala4 个月前
Hi, I&#x27;m the core developer of VictoriaLogs - zero-config schemaless open-source database for logs. Recently I tried running ClickHouse benchmark on it [1]. This benchmark executes various analytical queries over a table with 100 million rows. Every row represents an ad serving event with ~100 different fields such as UserID, ClientIP, AdvEngineID and so on. You can look at the table definition at [2].<p>Why running analytical benchmark against database for logs? VictoriaLogs is designed as a database for logs. It supports both plaintext and structured logs. Structured logs can be written to a single table with pre-defined columns for every field seen in the structured logs. So rows with ad serving events from ClickBench can be treated as structured logs with many fields. Such logs are known also as wide events [3].<p>VictoriaLogs has some optimizations for wide events. For example, it stores data per each column in distinct blocks on disk (aka column-oriented storage). This allows reading data only for the needed columns during query execution. That&#x27;s why I decided giving VictoriaLogs a try at ClickBench [4].<p>It has been appeared that VictoriaLogs shows good results there:<p>- it needs 4.5x less disk space than Elasticsearch and PostgreSQL, and 5x less disk space than MongoDB<p>- it loads data 4.7x faster than Elasticsearch and 21x faster than MongoDB<p>- it executes queries 9.3x faster than Elasticsearch, 111x faster than PostgreSQL and 51x faster than MongoDB on average<p>You can easily run and reproduce the benchmark on your hardware by cloning ClickBench [5] and executing benchmark.sh script per each database you want to test (each benchmark.sh script is located in the folder with the corresponding database name).<p>[1] https:&#x2F;&#x2F;benchmark.clickhouse.com&#x2F;<p>[2] https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickBench&#x2F;blob&#x2F;main&#x2F;clickhouse&#x2F;create.sql<p>[3] https:&#x2F;&#x2F;jeremymorrell.dev&#x2F;blog&#x2F;a-practitioners-guide-to-wide-events&#x2F;<p>[4] https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickBench&#x2F;tree&#x2F;main&#x2F;victorialogs<p>[5] https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickBench

1 comment

valyala4 个月前
Pay attention that VictoriaLogs doesn&#x27;t need any configuration and table schema in this benchmark - it is enough to ingest JSON lines, where every line contains a single ad serving event [1].<p>Also it is interesting to compare the original SQL queries [2] to LogsQL queries [3]. LogsQL queries are shorter and they are easier to understand even if you aren&#x27;t familiar with LogsQL. See how to convert SQL to LogsQL [4].<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickBench&#x2F;tree&#x2F;main&#x2F;victorialogs">https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickBench&#x2F;tree&#x2F;main&#x2F;victorial...</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickBench&#x2F;blob&#x2F;main&#x2F;clickhouse&#x2F;queries.sql">https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickBench&#x2F;blob&#x2F;main&#x2F;clickhous...</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickBench&#x2F;blob&#x2F;main&#x2F;victorialogs&#x2F;queries.logsql">https:&#x2F;&#x2F;github.com&#x2F;ClickHouse&#x2F;ClickBench&#x2F;blob&#x2F;main&#x2F;victorial...</a><p>[4] <a href="https:&#x2F;&#x2F;docs.victoriametrics.com&#x2F;victorialogs&#x2F;sql-to-logsql&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.victoriametrics.com&#x2F;victorialogs&#x2F;sql-to-logsql&#x2F;</a>