ClickHouse, a 1.5 million line C++ analytics database, shares lessons from their incremental migration to Rust. Rather than a full rewrite, the team integrated Rust modules for specific features like BLAKE3 hashing and Delta Lake support. Key challenges included managing reproducible builds, handling 672 additional Rust dependencies, writing C++/Rust interop wrappers, and dealing with excessive panic behavior in Rust libraries. While Rust offers memory and thread safety advantages, combining it with C++ introduces complexity around build systems, sanitization, and cross-compilation. The team now accepts Rust contributions but has decided against a complete rewrite.
Table of contents
The Price of C++ Is a Humongous Build SystemThe Rust JourneyDangers With Rust and C++Clickhouse’s TakeawaySort: