---
title: "ClickHouse and dbt - A Gift from the Community"
description: "The dbt-clickhouse adapter, started by community contributor Dmitriy Sokolov and later taken over as a vendor-supported plugin, maps dbt's view, table, incremental and ephemeral materializations onto ClickHouse features."
url: "https://swe.quest/articles/clickhouse-and-dbt-a-gift-from-the-community-edc7ddee62ee1cfc"
canonical: "https://clickhouse.com/blog/clickhouse-dbt-project-introduction-and-webinar"
source: "ClickHouse"
published: "2023-02-01"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 7
tags: ["analytics","data-pipelines","open-source"]
---

# ClickHouse and dbt - A Gift from the Community

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2023-02-01, 7 min read, Deep dive. Original: [https://clickhouse.com/blog/clickhouse-dbt-project-introduction-and-webinar](https://clickhouse.com/blog/clickhouse-dbt-project-introduction-and-webinar)

## Summary

The dbt-clickhouse adapter, started by community contributor Dmitriy Sokolov and later taken over as a vendor-supported plugin, maps dbt's view, table, incremental and ephemeral materializations onto ClickHouse features. The default incremental strategy builds a temporary table of changed rows, copies all unchanged rows into a new table and atomically swaps it in, which duplicates the whole dataset on every run. A newer delete+insert strategy uses ClickHouse 22.8's experimental lightweight deletes (tombstones removed during merges) to write only the changed rows and performs significantly better. Its caveats: it needs the experimental setting enabled, and because it modifies the target table directly with no transaction, a failure can leave the model in an invalid state.

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)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- ELT data modeling
- ClickHouse MergeTree basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

ClickHouse, dbt, dbt-clickhouse, lightweight deletes, MergeTree, Jinja

## Related posts

- [ClickHouse Newsletter April 2023: Lightweight Deletes](https://swe.quest/articles/clickhouse-newsletter-april-2023-lightweight-deletes-81a82ae9ad782b41.md): ClickHouse · 2023-04-25 · Medium · 6 min read · Analytics & OLAP, Schema migrations, Data pipelines
  ClickHouse 23.3 makes lightweight deletes (DELETE FROM with a row condition) generally available and the preferred way to remove data, and also adds trace visualization to the Grafana plugin and parallel replicas that split a shard's data across replicas.
- [Handling Updates and Deletes in ClickHouse](https://swe.quest/articles/handling-updates-and-deletes-in-clickhouse-197a09a41f4d2486.md): ClickHouse · 2023-03-10 · Medium · 13 min read · Analytics & OLAP, Databases, Storage engines, SQL
  ClickHouse offers several ways to modify mostly-immutable analytical data, each with different costs.
- [How Spyne simplified their CDC pipeline with ClickPipes and ClickHouse Cloud](https://swe.quest/articles/how-spyne-simplified-their-cdc-pipeline-with-clickpipes-and-clickhouse-cloud-44d67da08e6e4dbc.md): ClickHouse · 2026-06-22 · Medium · 6 min read · Event-driven architecture, Data pipelines, Analytics & OLAP, Schema migrations
  Spyne replaced a self-managed Debezium → Kafka → ClickHouse Kafka-engine/materialized-view CDC pipeline with ClickPipes on ClickHouse Cloud.
- [Postgres to ClickHouse: Data Modeling Tips](https://swe.quest/articles/postgres-to-clickhouse-data-modeling-tips-aec1f81e14af15d4.md): ClickHouse · 2024-08-28 · Medium · 9 min read · Analytics & OLAP, PostgreSQL, Event-driven architecture, SQL, Replication
  Postgres tables replicated to ClickHouse via PeerDB land in ReplacingMergeTree tables where updates and deletes arrive as versioned inserts (\_peerdb\_version, \_peerdb\_is\_deleted), so duplicates persist until background merges run.
- [Postgres to ClickHouse: Data Modeling Tips V2](https://swe.quest/articles/postgres-to-clickhouse-data-modeling-tips-v2-421af33ac59693d5.md): ClickHouse · 2025-03-06 · Medium · 21 min read · Analytics & OLAP, PostgreSQL, Event-driven architecture, Replication, SQL
  Postgres CDC into ClickHouse (via PeerDB or ClickPipes) uses logical decoding and maps tables to ReplacingMergeTree.

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)
