Elasticsearch LogsDB vs Standard Mode: Storage Efficiency Benchmark

Compare storage metrics for Elasticsearch LogsDB and Standard modes. Use these benchmarks to select the optimal index mode for your logging requirements.

This article compares the performance and storage of standard Elasticsearch indices and LogsDB. We used Elasticsearch Rally (esrally) to benchmark data ingestion and storage size.

Elasticsearch version 8.17 introduced LogsDB. This index mode optimizes log data storage through index sorting, advanced compression, and synthetic _source reconstruction. These features improve storage efficiency for large log datasets.

Benchmark Setup

We ran Elasticsearch Rally to simulate real-world data ingestion. We tested both standard and LogsDB indices.

Tools and Environment

Configure Elasticsearch Rally

Execute the following steps to prepare the environment:

Install Docker

Retrieve the Rally Image

docker pull elastic/rally
  1. View Available Tracks
sudo docker run elastic/rally list tracks

Create a Persistent Volume

docker volume create rally_data

Run the Benchmark

docker run -d --rm -v rally_data: /rally/.rally elastic/rally race \ --track=tsdb \ --pipeline=benchmark-only \ --target-hosts=<es-url> :9243 \ --client-options= "use_ssl:true,verify_certs:true,basic_auth_user:'elastic',basic_auth_password:'<password>'" \ --track-params= '{ "bulk_indexing_clients" :25, "ingest_percentage" :100}' \
  1. The setup creates 116,633,698 documents in Elasticsearch.
  1. We run this process for the standard index and logsdb.

We prepare two index templates:

Update Index Settings

Benchmark setup required updated index settings to optimize performance for standard indices and LogsDB. Applied configurations:

An Elasticsearch index template applied these settings. All indices matching the pattern inherit these configurations automatically.

Standard Index Settings

{ "settings": { "index": { "mode": "standard" , "codec": "default" , "mapping": { "synthetic_source_keep": "none" }, "sort": { "field": [], "order": [], "mode": [], "missing": [] } } }}

LogsDB Index Configuration

{ "index": { "mode": "logsdb" , "mapping.synthetic_source_keep": "arrays" , "sort.field": [ " host.name " , "@timestamp" ], "sort.order": [ "desc" , "desc" ], "sort.mode": [ "min" , "min" ], "sort.missing": [ "_first" , "_first" ], "codec": "best_compression" , "mapping.ignore_malformed": true , "mapping.ignore_above": 8191 , " mapping.total _fields.ignore_dynamic_beyond_limit": true }}

LogsDB Optimization Parameters

LogsDB uses three techniques for efficient performance. The Elasticsearch index settings show these techniques:

Optimized Index Sorting

Enhanced Compression

"codec": "best_compression" applies optimized compression (Zstandard, delta encoding) to reduce storage. Performance remains stable.

synthetic_source

"mapping.synthetic_source_keep": "arrays" retains essential arrays. It discards the full _source and reconstructs data only when needed. This reduces storage usage.

Additional Performance Adjustments

Data Ingestion and Storage Metrics

Benchmark Results

Each Rally run ingests 116,633,698 documents. To complete the dataset, we ran 8 cycles in standard mode and 8 cycles with the LogsDB index.

Standard Index

LogsDB Index

Storage Reduction: LogsDB reduced storage by 46.01% compared to standard mode.

Key Takeaways

Evaluate LogsDB if you scale log ingestion in Elastic.