ClickHouse

Add ClickHouse in dFlow for analytics workloads, deploy it, use CLICKHOUSE reference variables, and understand multi-port Expose when needed.

Written By Team dFlow

Last updated 3 days ago

ClickHouse is built for analytics: large tables, fast aggregations, and reporting-style queries. In dFlow it appears as ClickHouse in the database list and runs like your other database services.

General database workflow: Databases overview


On this page

  • When ClickHouse is a good fit

  • Create and deploy

  • Overview connection fields

  • Reference variables (CLICKHOUSE_…)

  • Expose (multiple public ports)

  • Day-to-day operations


When to choose ClickHouse

Pick ClickHouse for OLAP-style workloads: dashboards, event analytics, log-style queries at scale. For typical transactional app data (users, orders, permissions), Postgres or MySQL is usually simpler.


Set up ClickHouse in dFlow

  1. ApplicationsEnvironmentAdd NewAdd serviceDatabaseClickHouse.

  2. Create ServiceDeploy.

  3. Wait until Deploy completes; dFlow handles server setup for you.

Your connection URL uses the clickhouse:// style when it’s available; username and password appear when they’re part of that URL.


Your connection details

After a successful deploy, Internal credentials can include:

  • Connection URL

  • Username and password (when present)

  • Hostname and port

  • Database name (when it’s part of the URL)

Use these for in-environment apps, workers, or ETL. Public fields show up after Expose.


Link your app with reference variables

On an app or Docker service, open the Variables tab and use { } Reference variables:

{{ my-analytics.CLICKHOUSE_URI }}

Suffix

What it fills in

_URI

Internal URL

_NAME

Database name when parsed

_USERNAME

User

_PASSWORD

Password

_HOST

Internal host

_PORT

Internal port

_PUBLIC_HOST, _PUBLIC_PORT, _PUBLIC_URI

After Expose


Internet access (Expose)

Like MongoDB, ClickHouse may use more than one public port when exposed. You still use one Expose action; Overview shows how to connect through dFlow’s database gateway or your server’s address.

For heavy query traffic, internal connections from services in the same environment usually perform better than routing through the public path.

Unexpose before Stop if the database was exposed.


Day-to-day management

Deploy, Restart, Stop, Expose, and Unexpose work like other databases.


Useful links