Home / Companies / ClickHouse / Blog / Post Details
Content Deep Dive

How to use Rust in ClickHouse: avoiding a full rewrite

Blog post from ClickHouse

Post Details
Company
Date Published
Author
Alexey Milovidov
Word Count
2,630
Language
English
Hacker News Points
-
Summary

At the P99 conference, a ClickHouse developer discussed the company's exploration of integrating Rust into its primarily C++ codebase, highlighting the potential shift from C++ to Rust due to its memory and thread safety benefits. While C++ has been dominant in database management systems, its issues with memory safety, segmentation faults, and race conditions prompted the consideration of Rust as an alternative. The approach taken by ClickHouse was iterative rather than a full rewrite, starting with introducing Rust into their CMake build system via the Corrosion project and testing it with non-critical tasks like implementing a new SQL function. This integration saw successes, such as contributions to the ClickHouse client and the inclusion of a library for Delta Lake, though challenges arose, including reproducibility of builds, cross-compilation issues, and managing dependencies. Despite these hurdles, Rust's modularity and the interest from developers in using it offer a promising avenue for future development, encouraging contributions to ClickHouse in Rust.