Introducing the (blazing fast!) native TCP client for .NET
ClickHouse's new experimental .NET client in the ClickHouse.Driver package speaks the native TCP protocol and the columnar Native format. This removes the row/column conversions that HTTP with RowBinary forces on both server and client. It is built on zero-copy, pooled buffers and MemoryMarshal reinterpretation, with compiled expression-tree mappers for POCOs and SIMD where wire and .NET layouts differ (e.g. UUID). The result is 1.5-2x faster reads and inserts than HTTP, up to 1.1M rows/s on a single stream, and allocations for a 1M-row read cut from 1.6 GB to 6 MB. The tradeoffs: no ADO.NET/ORM support, text-only JSON, borrowed blocks valid for one iteration, and little gain on the object[] tier.
Related posts
- ClickHouse.Driver 1.0.0: The Official .NET Client Hits Stable
ClickHouse mediumAdept
ClickHouse.Driver 1.0.0 is the first stable release of the official .NET client for ClickHouse, committing to a semver-stable public API. It introduces a thread-safe, singleton-friendly ClickHouseClient that replaces most ADO.NET usage and the deprecated ClickHouseBulkCopy, and adds parameter type extraction from SQL, JWT/roles/custom headers, POCO serialization to JSON columns, mid-stream exception detection and QBit vector support. Breaking changes matter for upgrades: .NET Framework/Standard support is dropped, timezone-less DateTime columns now return Kind=Unspecified, and JSON writes default to string mode parsed server-side, which can change inferred types (e.g. Int32 to Int64).
- What's new in the ClickHouse .NET Driver: the road from 1.0 to 1.3
ClickHouse mediumAdept
ClickHouse's .NET driver versions 1.1 through 1.3 rework the insert, read and parameter paths. POCO registration replaces hand-built object[] rows for both inserts and typed QueryAsync<T> reads, with eager validation, precompiled accessors, attribute-based column mapping and JSON column support. Three optional extension points (IParameterTypeResolver, IParameterFormatter, IReadValueConverter) let callers control type inference, wire formatting and read-side conversion, and add no overhead when unused. The releases also add multidimensional arrays, ValueTuples and server-side Identifier parameters, plus a breaking fix that sends UTC/Local DateTime parameters as DateTime('UTC') so values are no longer shifted by the server's session time zone.
- ClickHouse Input format matchup: Which is fastest & most efficient
ClickHouse mediumAdept
FastFormats is a benchmark that measures ClickHouse server-side ingestion time and hardware efficiency across roughly 60 input formats, crossed with batch size, pre-sorting and compression, using the ClickBench web analytics dataset over the HTTP interface. With 10k-row batches and LZ4 compression, the Native format was fastest: 131s for 2.55 GiB. That beat ArrowStream by 10%, RowBinary by 18%, TSV and Parquet by about 31–32%, CSV by 36%, and JSONEachRow by 51%, because its columnar layout closely matches MergeTree. Format choice has the biggest impact, followed by compression, while pre-sorting helps only in specific cases. Native is recommended unless the table DDL uses format-specific MATERIALIZED/DEFAULT expressions.
- Designing the new async-native ClickHouse Python client
ClickHouse mediumAdept
The new async-native clickhouse-connect client replaces the legacy thread-pool wrapper with aiohttp for network I/O and a half-sync/half-async design: an async producer streams response chunks into a bounded queue (10 chunks of up to 1MB) while the existing synchronous Native-format parser consumes them in an executor thread, with the same queue reversed for inserts. This caps buffered memory at about 10MB, pipelines download and parsing, and propagates errors across the boundary. Benchmarks against ClickHouse Cloud show parity at concurrency 1 and a 1.16x geometric-mean speedup overall, up to 1.51x on mixed workloads. P95 latency is also far more stable than with the legacy client. The release candidate v0.12.0rc1 is available for testing.
- Why ClickHouse Cloud wins at real-time analytics
ClickHouse mediumAdept
In the CostBench streaming benchmark (113.2 billion stock quotes ingested at about 1M rows/s while queries ran), ClickHouse Cloud scored 412× to 1,996× better end-to-end performance per dollar than Snowflake, Databricks, BigQuery and Redshift Serverless. Its lead comes from sorting data and computing incremental materialized-view pre-aggregations in memory at insert time, so summaries never lag behind raw data. Background part merges then keep combining the mergeable aggregation states. Ingestion and merging are parallelized across nodes, cores and SIMD lanes, and a 4-core ingest service prepared all the data for $28.69 with 14.4× compression, while the other systems needed separate asynchronous refresh stages that lagged and cost $79–$696.