Can you render ray tracing inside your database? If you use ClickHouse, you can! This video was rendered entirely inside ClickHouse:
clickhou.se/4bjNiqe
A ray tracer computes lighting math for every pixel, millions of times over, and none of those calculations depend on each other. The query generates one row per pixel, ClickHouse spreads the work across every CPU core at once, then a GROUP BY collapses it into the final image. It is the same pattern as scanning a billion rows and aggregating them, which is what an analytical database does all day. The only difference is that the output is a picture instead of a number.
So why do it? Partly because it's fun. But also because it's hard.
ClickHouse users push the database hard every day, and projects like this give us novel ways to push it even harder. Building this, Alexey Milovidov found real improvements to make, like better recursive CTEs, optimization-pass fixes for complex queries, and loads of ideas for improving JIT compilation to speed up heavy math. Stuff that improves the core engine for real, everyday queries.
It also forced us to finish a long-standing wish: rasterising images straight from ClickHouse with FORMAT PNG. ClickHouse is often used to wrangle the data behind visualisations, and most of the time you reach for a tool like Grafana, Hex or just matplotlib to do the plotting. But sometimes you just want to drop a quick heatmap in Slack, and now you can do that with ClickHouse pushing the pixels itself.
Is ClickHouse pivoting to replace Blender? No. But building the fastest database in the world doesn't have to be boring!