---
title: "Building a Medallion architecture with ClickHouse"
description: "The Medallion architecture's bronze, silver and gold tiers can be built entirely from native ClickHouse features instead of Spark and Delta Lake."
url: "https://swe.quest/articles/building-a-medallion-architecture-with-clickhouse-9488d8022c239606"
canonical: "https://clickhouse.com/blog/building-a-medallion-architecture-with-clickhouse"
source: "ClickHouse"
published: "2024-12-12"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 11
tags: ["analytics","data-pipelines","system-design"]
---

# Building a Medallion architecture with ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2024-12-12, 11 min read, Deep dive. Original: [https://clickhouse.com/blog/building-a-medallion-architecture-with-clickhouse](https://clickhouse.com/blog/building-a-medallion-architecture-with-clickhouse)

## Summary

The Medallion architecture's bronze, silver and gold tiers can be built entirely from native ClickHouse features instead of Spark and Delta Lake. Bronze uses insert-optimized MergeTree tables with the JSON type, materialized columns and TTL, fed by S3Queue, ClickPipes or Kafka. Silver is populated by incremental materialized views with dead-letter routing and ReplacingMergeTree for deduplication and CDC, which requires FINAL at query time. Gold uses refreshable materialized views for joins and denormalization, plus AggregatingMergeTree for precomputed aggregates, at the cost of data replication and extra pipeline management.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)

## Prerequisites

- ClickHouse MergeTree basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- materialized views
- data warehouse concepts ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

ClickHouse, Medallion architecture, ReplacingMergeTree, AggregatingMergeTree, S3Queue, ClickPipes, Refreshable Materialized Views

## Related posts

- [Building a Medallion architecture for Bluesky data with ClickHouse](https://swe.quest/articles/building-a-medallion-architecture-for-bluesky-data-with-clickhouse-37b9d3fcf0db6cec.md): ClickHouse · 2025-01-08 · Medium · 26 min read · Analytics & OLAP, Data pipelines, Databases, SQL
  A Medallion pipeline (Bronze, Silver, Gold) in ClickHouse ingests and cleans the high-volume Bluesky Jetstream feed, which arrives with malformed JSON, inconsistent and invalid timestamps, recursive structures and frequent duplicates.
- [Building a product analytics solution with ClickHouse](https://swe.quest/articles/building-a-product-analytics-solution-with-clickhouse-786424348993d92f.md): ClickHouse · 2024-12-05 · Medium · 24 min read · Analytics & OLAP, SQL, Databases, Product engineering
  ClickHouse's in-house product analytics platform, Galaxy, stores over 20 billion events (14 TB, roughly 14x compression) in a single denormalized MergeTree table keyed on created\_at.
- [ClickHouse Release 23.12](https://swe.quest/articles/clickhouse-release-23-12-36e0c0d21cc33770.md): ClickHouse · 2024-01-11 · Medium · 16 min read · Analytics & OLAP, Query engines, SQL, Performance engineering
  ClickHouse 23.12 adds experimental Refreshable Materialized Views, which periodically re-run an arbitrary query and atomically replace the results in a target table.
- [Chaining Materialized Views in ClickHouse](https://swe.quest/articles/chaining-materialized-views-in-clickhouse-79c630686e93ebe9.md): ClickHouse · 2024-04-16 · Medium · 8 min read · Analytics & OLAP, Stream processing, SQL
  ClickHouse materialized views can be chained so that one view reads from a table populated by another, rather than having several views all read from the same Kafka engine table.
- [Goldsky - A Gold Standard Architecture with ClickHouse and Redpanda](https://swe.quest/articles/goldsky-a-gold-standard-architecture-with-clickhouse-and-redpanda-347e225c0fe7c7a7.md): ClickHouse · 2023-12-20 · Medium · 9 min read · Analytics & OLAP, Stream processing, Queues & messaging, Multi-tenancy, Data pipelines
  Goldsky streams blockchain data to potentially thousands of customer ClickHouse clusters by indexing chains into per-data-type Redpanda topics (Avro, infinite retention via tiered storage), applying per-customer FlinkSQL filters, joins and aggregations in stream at up to 500k events/sec, and delivering results to ClickHouse.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
