---
title: "The billion docs JSON Challenge: ClickHouse vs. MongoDB, Elasticsearch, and more"
description: "JSONBench is a reproducible benchmark that loads up to one billion Bluesky event JSON documents into ClickHouse, MongoDB, Elasticsearch, DuckDB and PostgreSQL, then measures storage size and the speed of five analytical queries."
url: "https://swe.quest/articles/the-billion-docs-json-challenge-clickhouse-vs-mongodb-elasticsearch-and-more-e942a192bad31355"
canonical: "https://clickhouse.com/blog/json-bench-clickhouse-vs-mongodb-elasticsearch-duckdb-postgresql"
source: "ClickHouse"
published: "2025-01-29"
difficulty: "medium"
kind: "Research"
reading_minutes: 28
tags: ["analytics","databases","storage-engines","performance"]
---

# The billion docs JSON Challenge: ClickHouse vs. MongoDB, Elasticsearch, and more

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2025-01-29, 28 min read, Research. Original: [https://clickhouse.com/blog/json-bench-clickhouse-vs-mongodb-elasticsearch-duckdb-postgresql](https://clickhouse.com/blog/json-bench-clickhouse-vs-mongodb-elasticsearch-duckdb-postgresql)

## Summary

JSONBench is a reproducible benchmark that loads up to one billion Bluesky event JSON documents into ClickHouse, MongoDB, Elasticsearch, DuckDB and PostgreSQL, then measures storage size and the speed of five analytical queries. ClickHouse's columnar JSON type stores each JSON path as a separate compressed column. In these tests it used 40% less storage and ran aggregations 2500x faster than MongoDB, used half the storage and ran 10x faster than Elasticsearch, and was several thousand times faster than DuckDB and PostgreSQL while using 5-6x less disk. The write-up explains each system's JSON storage model, compression, sorting, indexes and caches, and how each was configured for a fair comparison, such as MongoDB covered index scans and Elasticsearch with \_source disabled.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- columnar storage basics
- JSON document databases ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))
- database indexes ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

ClickHouse, JSONBench, MongoDB, Elasticsearch, DuckDB, PostgreSQL, WiredTiger, Bluesky

## Related posts

- [What really matters for performance: lessons from a year of benchmarks](https://swe.quest/articles/what-really-matters-for-performance-lessons-from-a-year-of-benchmarks-0ec8700c872ad4a4.md): ClickHouse · 2025-12-22 · Easy · 7 min read · Analytics & OLAP, Performance engineering, Caching, Databases
  Six ClickHouse benchmarks from 2025 point to one conclusion: performance depends on how efficiently an engine moves data end-to-end.
- [The world’s fastest tool for querying JSON files](https://swe.quest/articles/the-world-s-fastest-tool-for-querying-json-files-5bf7115ac2686d02.md): ClickHouse · 2022-10-14 · Easy · 3 min read · Performance engineering, Analytics & OLAP, SQL
  clickhouse-local, a single-binary SQL engine for local and remote files, outperforms SPySQL, jq, trdsql, Miller, OctoSQL, spark-sql, Pandas and DSQ when querying large JSON files in the SPySQL benchmark on Amazon book reviews data.
- [Making complex JSON 58x faster, use 3,300x less memory, in ClickHouse](https://swe.quest/articles/making-complex-json-58x-faster-use-3-300x-less-memory-in-clickhouse-7431021b1253a468.md): ClickHouse · 2025-10-09 · Hard · 7 min read · Storage engines, Analytics & OLAP, Performance engineering
  ClickHouse v25.8 adds two new on-disk serializations for the JSON type's shared data, which holds paths beyond the 1,024 dynamic-subcolumn limit.
- [Longbridge Technology simplifies their architecture and achieves 10x performance boost with ClickHouse](https://swe.quest/articles/longbridge-technology-simplifies-their-architecture-and-achieves-10x-e3a982c02b6e4b33.md): ClickHouse · 2025-03-17 · Medium · 8 min read · Analytics & OLAP, Databases, PostgreSQL, Payments & fintech
  Longbridge, a Singapore online brokerage, replaced a fragmented market-data stack of PostgreSQL (historical), Redis (real-time) and DynamoDB (high-write) with ClickHouse after evaluating it against TimescaleDB and TDengine for write throughput, Decimal support, time functions and aggregations.
- [Do you still need Elasticsearch for log analytics? ClickHouse says no.](https://swe.quest/articles/do-you-still-need-elasticsearch-for-log-analytics-clickhouse-says-no-7011cded5588b0ad.md): ClickHouse · 2026-04-23 · Medium · 22 min read · Search, Analytics & OLAP, Observability, Performance engineering, Storage engines
  ClickHouse's redesigned inverted-index full-text search feeds matches directly into its vectorized analytical engine, and on a reproducible OpenTelemetry log benchmark at 1B, 10B and 50B rows it ran a nine-query search-plus-aggregation suite 2-6x faster than Elasticsearch, with a much smaller storage footprint.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
