# ClickHouse / DuckDB

Analytics you host. ClickHouse is Apache-2.0; DuckDB is MIT — Snowflake without the credit warehouse.

**Replaces:** Snowflake

**Tier:** Medium

## Problem

Snowflake sells compute credits on a warehouse you do not run. You wanted SQL over events or a dump you already have. ClickHouse is Apache-2.0 columnar analytics you can self-host. DuckDB is MIT embedded analytics for a laptop or a single process. Neither is a clone of Time Travel, Snowflake Marketplace, or every semi-structured function.

## Stack

- [ClickHouse](https://clickhouse.com) — Apache-2.0 columnar analytics database
- [DuckDB](https://duckdb.org) — MIT embedded analytics if the job is a file, not a cluster

## Estimated SaaS cost saved

| You stop paying | Typical / year | Self-host instead |
|---|---:|---|
| Snowflake (small team credits) | $2,400 | ClickHouse or DuckDB |

**About $2,400 / year** on a small team, before you count lock-in.

## Deploy on Railway

Placeholder: ClickHouse server + a volume, or DuckDB in-process if the job is a file. Dashboards can sit on /stacks/metabase-bi. No one-click template in this repo yet — Start on Railway.

[Start on Railway](https://c17.io/go/railway/clickhouse-warehouse?from=%2Fstacks%2Fclickhouse-warehouse.md)

[Metabase if people need a clicky BI UI on top of the warehouse](https://c17.io/stacks/metabase-bi)

## AGENT_PROMPT

```
Replace Snowflake with ClickHouse (preferred for a server) or DuckDB (embedded / local).

- ClickHouse: persist data on a volume, bind native + HTTP. DuckDB if the warehouse is a parquet/CSV on disk.
- Load one table you actually query. Do not claim Time Travel or Snowflake Marketplace.
- Metabase/Superset can sit on /stacks/metabase-bi. Write AGENT_PROMPT.md.
```

## FAQ

### ClickHouse or DuckDB?

ClickHouse if several people query a live dataset. DuckDB if the job is a laptop, a CI job, or a single Go process reading parquet. Metabase is the UI — /replace/looker.

### Will my Snowflake SQL run unchanged?

A lot of ANSI SQL will. Warehouse-specific functions will not. Rebuild the three queries people actually run.

Source: https://c17.io/stacks/clickhouse-warehouse
