My Quest for Speed: How a Clickhouse Type Improvement Led Me Down a Caching Rabbit Hole in Rust
dev.to·5h·
Discuss: DEV
Flag this post

It all started with a wonderful quality-of-life improvement in the clickhouse crate. The recent 0.14.0 release introduced support for the RowBinaryWithNamesAndTypes format. This was a game-changer!

Gone were the days of fetching data as untyped strings and manually converting them into Rust types like Decimal. Now, I could get strongly-typed rows directly, making my code safer, cleaner, and more pleasant to write.

But with great power comes great...greed.

Seeing my data pipeline become so elegant lit a fire in me. My Axum web application was now efficiently talking to ClickHouse, but I thought, “What if we could be even faster? Why hit the clickhouse database for every single request for spot prices?” The answer seemed obvious: cache it.

**The Naive Beginning: Infinite…

Similar Posts

Loading similar posts...