Combining Clickhouse MergeTree Engines and Materialized Views

Platforms
Combining Clickhouse MergeTree Engines and Materialized Views

Clickhouse Table Engines

When creating a Clickhouse table, the user needs to specify a table engine to describe how data should be stored and managed. Of these, the MergeTree engine tends to be the go to as it's the most general robust, robust and flexible options.

As well as the base MergeTree, Clickhouse includes specialised subtypes such as the SummingMergeTree and ReplacingMergreTree which provide additional logic as part of the merging process, such as rollups or only recording the last value for a key.

In this video, we demonstrate how we can build materialised views based on these table engines to provide a very elegant model for calculating derived views and analytics purely within Clickhouse based on some underlying table.

The end state is a base table of event data, and a series of materialised views which are updated asynchronously each time data in the underlying table changes.

In order to deliver near real-time scalable analytics with no external stream processing, this is one of the most elegant models we have seen.

If you would like to learn more about Clickhouse, please visit our hands on training course.

Hands-On Training For The Modern Data Stack

Timeflow Academy is an online, hands-on platform for learning about Data Engineering and Modern Cloud-Native Database management using tools such as DBT, Snowflake, Kafka, Spark and Airflow.

Join our mailing list for our latest insights on Data Engineering:

Timeflow Academy is the leading online, hands-on platform for learning about Data Engineering using the Modern Data Stack. Bought to you by Timeflow CI

© 2023 Timeflow Academy. All rights reserved