Connection fields
| Field | Required | Description |
|---|---|---|
host | yes | Hostname of your ClickHouse instance |
port | no | Defaults to 8443 (HTTPS). Use 8123 for plaintext HTTP — not recommended in production |
username | yes | ClickHouse user — needs SELECT on source data plus full DDL/DML on a Traffical-owned database (see below) |
password | yes | Password for the user |
database | yes | Default database |
8443 or 443. Other ports use HTTP.
Creating the user and grants
The pipeline reads from your source databases and writes intermediate tables into a Traffical-owned database. Both kinds of access live on a single user.CREATE DATABASE at the cluster level, pre-create the database and grant explicitly:
ALTER is needed because the overlap-delete pattern uses ALTER TABLE ... DELETE WHERE ... on ClickHouse (ClickHouse doesn’t support point DELETE syntax on MergeTree). The pipeline already runs this with SETTINGS mutations_sync = 1 so it’s synchronous from the pipeline’s point of view.
If you prefer SHA256 hashed passwords:
analytics with the database your assignment and fact tables live in.
Recommended schema layout
ClickHouse’s strength is fast time-series scans. UseMergeTree-family engines and partition on time:
ORDER BY keys are also indexes — leading with event_time makes the pipeline’s date-range filters cheap.
Example definitions
Assignment definition SQL:Network access
ClickHouse exposes HTTPS on port 8443 by default for managed deployments. Traffical connects directly:- ClickHouse Cloud / Altinity.Cloud / Tinybird — add Traffical’s egress IPs to the service’s IP allowlist (in Settings → Warehouse).
- Self-hosted — open port 8443 (or your chosen HTTPS port) from Traffical’s IPs through any firewall.
Performance tips
- Partition on time. Pretty much every query the pipeline runs filters by time — partitioning ensures only relevant parts are scanned.
LowCardinality(String). Use it for columns with few distinct values (status codes, country, currency, allocation name). It reduces storage and speeds up filters.- Materialized views for pre-aggregation. If you have a very large facts table, consider a materialized view that pre-aggregates per (day, user). Point the fact definition at the materialized view.
- Skip indexes on
user_idif you have high cardinality and frequent user-level joins.
Gotchas
- HTTP vs HTTPS. The connection uses HTTPS by default. If you set
portto a plaintext port (8123), credentials travel unencrypted — only do this on a private network. - DateTime precision. Use
DateTime64(3, 'UTC')(millisecond precision, UTC) for time columns. Mixed precisions can cause subtle bugs in time-window filters. Distributedtables. If you query a distributed table, make sure the underlying tables on each shard have consistent schemas. Pipeline errors otherwise show up as cryptic column-mismatch messages.SELECT *is fine but slow. ClickHouse is columnar; only project the columns you actually use.