All skills
clickhouse avatar

/clickhouse-architecture-advisor

@5e162d6 official
by clickhouseclickhouse/agent-skills543 stars
39

MUST USE when designing ClickHouse architectures, selecting between ingestion or modeling patterns, or translating best practices into workload-specific system designs. Complements clickhouse-best-practices with decision frameworks and explicit provenance labels.

Use this Skill: https://skilld.dev/gh/clickhouse/agent-skills/clickhouse-architecture-advisor

This session only. Nothing lands on disk.

examplesfinserv-market-surveillance.md

≈785 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Example: Financial Services — Real-time market surveillance

Scenario

  • Workload: order and execution event stream
  • Ingest rate: 80M events/day
  • Query pattern:
    • latest order state
    • time-bounded compliance scans
    • intraday anomaly and pattern detection
  • Freshness target: sub-second to low-single-digit seconds
  • Additional requirement: late-arriving corrections and cancels

Workload Summary

This is not classic OLTP. It is a high-throughput analytical event pipeline with mutable business state derived from ordered events. The architecture should preserve append-only facts and compute latest-state views rather than forcing row-by-row transactional mutations.

Key Decisions

  1. Keep a raw append-only event table
  2. Model current state separately
  3. Avoid using ClickHouse like a row store
  4. Use pre-aggregation only for repeated surveillance views

Recommendations

1. Raw event table plus latest-state projection

What
Store all order lifecycle events immutably, then derive current order state.

Why
This preserves auditability and handles late-arriving business events without relying on heavy mutations.

Category
derived

Confidence
medium

Source

2. Use ReplacingMergeTree for current-state table if version semantics are clean

What
Maintain a latest-state table keyed by order identifier and version timestamp.

Why
If corrections naturally replace prior state, ReplacingMergeTree is often the cleanest documented pattern.

Category
official

Confidence
high

Source

3. Use dictionaries for small reference data used in surveillance rules

What
Use dictionaries for symbol metadata, venue mappings, or account-tier lookups if they are read constantly and update slowly.

Why
Repeated runtime joins in hot surveillance logic are often more expensive than key-based dictionary lookup.

Category
official

Confidence
high

Source

Example raw events table

CREATE TABLE order_events
(
    event_time DateTime64(3),
    trade_date Date,
    order_id String,
    account_id String,
    symbol LowCardinality(String),
    venue LowCardinality(String),
    event_type LowCardinality(String),
    qty UInt64,
    px Decimal(18, 6),
    version_ts DateTime64(3)
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(trade_date)
ORDER BY (trade_date, symbol, order_id, event_time);

Example current-state table

CREATE TABLE order_state_latest
(
    order_id String,
    symbol LowCardinality(String),
    venue LowCardinality(String),
    status LowCardinality(String),
    qty UInt64,
    px Decimal(18, 6),
    version_ts DateTime64(3)
)
ENGINE = ReplacingMergeTree(version_ts)
ORDER BY (order_id);

Caveat

This pattern is architectural, not transactional. If the requirement is strict OLTP locking semantics with many point updates per key, ClickHouse should not be the system of record for that path.

Source: SKILL.md on GitHub

No alerts17d4 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill is a safe architectural advisor for ClickHouse workloads. It provides structured decision frameworks for ingestion, partitioning, and schema design based on official documentation. No malicious patterns, data exfiltration, or dangerous execution triggers were detected.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 5e162d6. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 6 months ago
metadata
{
  "author": "ClickHouse Inc",
  "version": "0.1.0"
}
  • clickhouse
  • architecture
  • olap
  • ingestion
  • time-series
  • schema-design
  • partitioning
  • joins
  • telemetry

README badge

README badge for clickhouse/agent-skills/clickhouse-architecture-advisor

Guides ClickHouse architecture decisions for specific workloads—observability, analytics, IoT, financial services—by mapping workload shape to ingestion, partitioning, and join strategies with official documentation links. Classifies recommendations by provenance (official, derived, field) to separate documented behavior from heuristic field guidance.

Generated from the current SKILL.md.

Does this skill replace the clickhouse-best-practices skill?
No. This skill complements clickhouse-best-practices by adding workload-aware decision frameworks and provenance labels. Official documentation remains the source of truth for both.
What workload types does this skill cover?
Observability, security/SIEM, product analytics, IoT/telemetry, market data/financial services, and mixed OLAP with point-lookups. Each has scenario-specific rule files for ingestion, time-series retention, enrichment, and late-arriving events.
How does this skill distinguish between official, derived, and field guidance?
Official recommendations are directly from ClickHouse docs. Derived recommendations follow logically from documented behavior. Field recommendations are experience-based and include a disclaimer that they are heuristic and workload-dependent.
What should I do if a recommendation is uncertain?
The skill explicitly states when a recommendation is uncertain rather than presenting it as confident guidance.

Generated from the current SKILL.md. These answers refresh after source changes.