Migrate to ClickHouse

Migrate from MongoDB to ClickHouse

Keep MongoDB as the operational store and move the analytics to ClickHouse. Native JSON support, CDC from the change stream, and aggregations that return in milliseconds rather than minutes.

How the migration works
Sub second
Queries over billions of rows, from columnar storage and vectorised execution.
50%+
Cost savings observed in the migrations we have delivered from SQL Server, OpenSearch and Snowflake.
100s
Of concurrent users served with consistent latency, so analytics can go into your product.
Anywhere
Open source. Run it on any cloud, on premise or as ClickHouse Cloud.
Why teams move

Why MongoDB users come to us

MongoDB is a good operational database for applications with flexible, document shaped data. The trouble starts when the business wants analytics over those documents. The aggregation pipeline is awkward for anything beyond simple grouping, it is slow over large collections, and running it against the production cluster hurts the application.

Most companies would face a large rewrite to move an application off MongoDB, and there is no reason to when it works well as the operational store. The pattern we deliver is to leave Mongo doing the transactions and replicate the documents into ClickHouse, where they can be queried with SQL, joined with other data and aggregated at speed.

This has become much easier recently. ClickHouse now has a native JSON type that stores documents columnar with dynamic paths, and ClickPipes has a MongoDB CDC connector that reads the change stream directly. The combination means flexible schemas no longer have to be flattened by hand before they can be analysed.

Sound familiar?
  • [01]Aggregation pipelines over large collections are slow and compete with the application for resources.
  • [02]Analysts cannot work with the data because it is not accessible with SQL or standard BI tools.
  • [03]Joining Mongo data with data from other systems means exporting it somewhere else first.
  • [04]Atlas cost rises with the analytics load, or a separate analytics node tier is being paid for.
  • [05]Nightly exports to a warehouse mean the numbers are always a day behind.
What changes

MongoDB to ClickHouse: faster, cheaper, simpler

ClickHouse is the fastest open source analytical database on the market. These are the differences that matter most for teams coming from this platform.

[01]

Native JSON, columnar speed

ClickHouse stores JSON documents as columns under the hood, so nested, variable schema data is queried with the same speed as a flat table and new fields appear without a migration.

[02]

SQL over your documents

Analysts, BI tools and AI agents query the data with standard SQL, including joins to other sources, rather than learning the aggregation pipeline or exporting to a spreadsheet.

[03]

The application is left alone

Analytical load moves off the MongoDB cluster entirely, so Atlas tiers or analytics nodes can be reduced and the application gets its performance back.

[04]

Seconds behind, not a day

CDC from the change stream keeps ClickHouse within seconds of MongoDB, so dashboards and reports reflect current data and materialised views keep aggregates up to date.

How we migrate

Accelerated migration with CDC

ClickPipes has a generally available MongoDB CDC connector that snapshots collections and then follows the change stream, landing documents in ClickHouse with native JSON support. Supermetal supports MongoDB as a source for self hosted ClickHouse. We design the target schema to decide which fields are promoted to typed columns for speed and which stay as JSON for flexibility, then run both systems side by side until the analytics are validated.

  1. 01

    Assess

    We review the schemas, the query workload and the cost of the current platform, then agree the scope, the target architecture and the business case before anything is built.

  2. 02

    Design the ClickHouse schema

    Tables are redesigned for columnar storage rather than copied across one to one. Sorting keys, partitioning, codecs and materialised views are chosen against your real queries.

  3. 03

    Load and replicate

    Historical data is bulk loaded, then changes are streamed continuously so ClickHouse stays in line with the source for as long as the two need to run side by side.

  4. 04

    Run in parallel

    Dashboards, applications and reports are pointed at ClickHouse and validated against the source. Performance and cost are measured rather than assumed.

  5. 05

    Cut over

    Workloads move across in stages, the old platform is scaled down and the remaining spend is retired. Nothing is switched off until the numbers reconcile.

  6. 06

    Support

    After go live we can monitor the environment, tune it as the workload grows and provide an escalation path under SLA through our proactive support service.

Tooling we use
ClickPipes

The managed ingestion service built into ClickHouse Cloud. Its CDC connectors take an initial snapshot and then stream every insert, update and delete, with no infrastructure for you to run.

Supermetal

A high performance CDC engine from supermetal.io that ships as a single binary and replicates from Postgres, MySQL, SQL Server, Oracle and MongoDB into ClickHouse, including self hosted clusters.

We are tool agnostic. The right choice depends on whether you are going to ClickHouse Cloud or self hosted, how much control you want over the pipeline and what else is in the stack. Zero downtime is the norm, not the exception.

Beyond the migration

One database, many use cases

Moving off MongoDB is usually the start. Because ClickHouse is so versatile, the same platform tends to pick up more workloads once it is in place.

Real time analytics

Dashboards and embedded analytics over data that is seconds old, served to many users at once.

Data warehousing

A warehouse that is fast enough to query directly, without the overnight batch or the cube layer.

Observability

Logs, metrics and traces at a fraction of the cost of Datadog, Splunk or Elastic, with ClickStack on top.

Time series

Market data, IoT, telemetry and events at hundreds of thousands of rows per second with long retention.

Search and security analytics

Full text search, SIEM and threat hunting over high volume event data using plain SQL.

Agentic AI

A data platform fast and cheap enough for agents that turn one question into dozens of queries.

Related work

Migrations we have delivered

Ready to move off MongoDB?

Start with a short call. We will look at your schemas, queries and current spend, tell you honestly whether ClickHouse is the right fit, and put a number on the performance and cost you can expect.

Support after go live