# New, Fast, Scalable ClickHouse Integration for High-Volume Networks | ntop

[Blog](https://www.ntop.org/blog/)[ntop](https://www.ntop.org/category/ntop/)[ntopng](https://www.ntop.org/category/ntopng/)

# New, Fast, Scalable ClickHouse Integration for High-Volume Networks

July 11, 20254 min read

When it comes to monitoring very large networks and the flows’ cardinality reaches into the billions, the performance of historical data storage and query systems becomes a critical bottleneck. Network operators, analysts, and engineers need to access flow records quickly and reliably, whether for traffic analysis, security investigations, or compliance reporting. When faced with massive datasets, even small inefficiencies in the data pipeline can result in slow queries, high CPU and disk usage, and poor responsiveness.

At ntop, our mission is to help users gain visibility into their networks with speed and precision. For this reason, over the past few months, we’ve undertaken a complete redesign of our ClickHouse integration in [ntopng](https://www.ntop.org/products/traffic-analysis/ntopng/), with one clear goal in mind: accelerate queries and improve performance at scale.

![Ntopng to clickhouse](/images/2025/07/ntopng-to-clickhouse.webp)

Whether you’re storing millions or billions of flow records, our new ClickHouse support ensures that queries return faster (much faster), exports scale better, and system resources are used more efficiently than ever before.

## Native ClickHouse API: A Clean Break from MySQL

One of the biggest architectural changes is the move away from using the MySQL API to interact with ClickHouse. While functional, the MySQL API was not designed to support the native data types and high-performance capabilities of ClickHouse. This led to unnecessary in-query data conversions. Also, it was definitely not optimize for high insertion throughput, and for this reason we were using CSV files, stored on disk, to implement batch insert.

For the above reasons, the ClickHouse support in ntopng has now completely reworked to use the native ClickHouse C++ API for all operations, which provides:

-   Native batch insertion using in-memory ClickHouse blocks.
-   High-speed, type-safe querying with no need for runtime data transformations.
-   An optimized database schema.
-   A cleaner, more robust codebase better aligned with ClickHouse’s architecture.

### Schema Optimizations

ClickHouse is a columnar database designed for performance, but only if used correctly. We’ve reworked the database schema to take full advantage of its strengths:

-   No more NULLABLE columns: in ClickHouse, these are implemented using a hidden indirection table, which [hurts performance](https://clickhouse.com/docs/optimize/avoid-nullable-columns). We’ve replaced them with proper default values and schema adjustments.
-   Improved partitioning and indexing: flows are now partitioned and indexed in a way that accelerates common queries dramatically, especially when dealing with large time ranges or filtering by interface.

#### Disk I/O Eliminated

Previously, flow data destined for ClickHouse was first serialized to CSV files and written to disk before being inserted. This approach introduced latency, consumed I/O bandwidth, and increased disk wear.

In the new implementation:

-   Data goes straight from memory to ClickHouse via native blocks, providing a performance boost from under 100k insert/sec to **over 200k insert/sec**.
-   FIFO queues have been introduced to handle traffic peaks and avoid any overhead in the flow processing path.
-   No intermediate files are created, reducing latency and system load.
-   Batching is now more efficient, with larger payloads sent in parallel.

##### Built to Scale

A common ntopng configuration when deployed across large networks includes the introduction of *view* interfaces, to aggregate multiple capture or collection interfaces into a single logical view. The new implementation has been designed with scalability and flexibility in mind:

-   Parallel inserts per interface: when multiple interfaces are aggregated into a view, each one now writes data to ClickHouse in parallel, maximizing throughput. An aggregated view is still available in the view interface.
-   Simultaneous exports to multiple backends: you can now export flow data to ClickHouse, Kafka, ElasticSearch, and syslog at the same time.

##### Export Statistics

To help you monitor and troubleshoot flow exports, we’ve added export statistics that are available:

-   Per interface
-   Per export method (ClickHouse, Kafka, ElasticSearch, Syslog)
-   You can now view export statistics directly from the Interface Details page in the GUI, making it easier to understand how each component of your data pipeline is performing.

##### Cleaner Codebase

The new implementation is built on a restructured codebase that introduces a single DataBase superclass used across all storage backends, including SQLite and ClickHouse. This brings:

-   Unified architecture for handling historical flows, alerts, assets, and more.
-   Easier future maintenance and expansion, as all database interactions follow the same internal interface.
-   Less duplication, fewer bugs, and more predictable behavior across modules.

##### Built for Today, Ready for Tomorrow

This work is not just a performance improvement, it’s a massive upgrade in terms of **performance, scalability, and efficiency**, that changes how we handle historical flow data at scale.

In real-world scenarios involving billions of flow records, we’ve observed dramatic improvements in query responsiveness. In some of the most common use cases, such as filtering flows by interface and time range, query times have dropped from over a minute to just a few seconds, and in many cases, to under one second. A **huge performance boost** that dramatically changes your traffic analysis experience.

We encourage all users to upgrade (if you are running **ntopng 6.5** from nightly builds, otherwise be patient and wait for the next stable release) and experience the performance gains firsthand. As always, we welcome your feedback and are here to help you make the most of your ntop-powered monitoring stack.

Enjoy!

**Related:**[ntopng](https://www.ntop.org/products/traffic-analysis/ntopng/), [Network traffic analysis software](https://www.ntop.org/network-traffic-analysis-software/)

## Keep reading

ntopngNov 23, 2026

### [Modeling Your Network: Part I](https://www.ntop.org/network-model-intro/)

ntopng is introducing continuous network learning to help administrators close visibility gaps in dynamic networks, starting with a new Server Model feature. Using DPI and historical flow data, the system passively discovers and baselines core servers—alerting operators to unauthorized services, unresponsive hosts, or traffic anomalies while automatically updating network configurations to reduce false-positive security alerts.

nDPINov 7, 2026

### [Detecting CVE-2026-98432 using nDPI/ntopng](https://www.ntop.org/detecting-cve-2026-98432-using-ndpi-ntopng/)

CVE-2026-98432 is a critical, 9.8-severity use-after-free (UAF) vulnerability in the Linux kernel’s IPv4 TCP networking stack. It allows an unauthenticated remote attacker to potentially cause system crashes, memory corruption, or execute arbitrary commands with root privileges. From a network stand

Technologies and TrendsOct 8, 2026

### [How we Redesigned Search in ntopng](https://www.ntop.org/how-we-redesigned-search-in-ntopng/)

ntopng has had a search box for a while, but it we made it better to allow search for menu entries too! This to speed up and improve the user experience and…

## Try it on your own network

Download the free Community edition and see your first flows in five minutes.

[Download ntopng free](https://www.ntop.org/support/documentation/software-installation/)[Talk to an engineer](https://www.ntop.org/support/need-help/contacts/)
Source: https://www.ntop.org/new-fast-scalable-clickhouse-integration-for-high-volume-networks/