ClickHouse

ClickHouse setup, CLICKHOUSE_ reference variables, multi-port Expose, and dashboard actions.

Written By Zoro

Last updated 28 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 mappings:

_URIInternal URL
_NAMEDatabase name when parsed
_USERNAMEUser
_PASSWORDPassword
_HOSTInternal host
_PORTInternal port
_PUBLIC_HOST, _PUBLIC_PORT, _PUBLIC_URIAfter 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

Restart, Stop, Expose, and Unexpose work like other databases; Deploy is only shown until the first successful provision. See Where things live in the dashboard.


Useful links