clickhouse-real-time-analytics
Skill49 starsChanged 6 months agoMITView on GitHub
Guides agents through ClickHouse-based real-time analytics design. Use when building fast analytical serving layers, event aggregations, materialized views, or low-latency metric access patterns.
In this repository80 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/00-data-agent-core.mdcCursor rule
- .cursor/rules/10-spec-first.mdcCursor rule
- .cursor/rules/20-platform-preset-selector.mdcCursor rule
- .cursor/rules/30-quality-gates.mdcCursor rule
- airflow-and-workflow-orchestrationSkill
- apache-beam-unified-batch-and-streamSkill
- apache-hudi-lakehouseSkill
- api-and-saas-ingestion-patternsSkill
- avro-protobuf-json-schema-registrySkill
- bigquery-and-dataform-platform-engineeringSkill
- cdc-and-incremental-loadingSkill
- data-catalog-and-discoverySkill
- data-contract-testing-with-schema-registrySkill
- data-lake-and-zone-architectureSkill
- data-mesh-and-domain-oriented-designSkill
- data-migration-and-platform-cutoverSkill
- data-observability-and-sla-managementSkill
- data-platform-ci-cd-and-release-managementSkill
- data-platform-disaster-recovery-and-business-continuitySkill
- data-platform-operating-model-and-service-ownershipSkill
- dataplex-and-bigquery-governanceSkill
- data-quality-and-contract-testingSkill
- data-quality-platforms-and-rule-managementSkill
- data-reconciliation-and-financial-controlsSkill
- data-resiliency-testing-and-failure-injectionSkill
- data-security-compliance-and-regulated-dataSkill
- data-sharing-and-publishing-contractsSkill
- data-specificationSkill
- dbt-and-analytics-engineeringSkill
- debezium-and-kafka-connect-cdcSkill
- delta-lake-and-medallion-architectureSkill
- duckdb-local-analytics-and-devSkill
- enterprise-etl-and-data-integration-modernizationSkill
- esg-and-sustainability-regulatory-reportingSkill
- etl-elt-and-modernization-strategySkill
- feature-store-and-ml-data-pipelinesSkill
- file-and-partner-feed-ingestionSkill
- glue-data-catalog-and-lake-formation-governanceSkill
- great-expectations-deequ-and-cualleeSkill
- incident-triage-and-pipeline-recoverySkill
- java-data-engineering-and-integration-servicesSkill
- kafka-resilience-and-schema-evolutionSkill
- lakefs-and-data-versioningSkill
- lakehouse-table-format-engineeringSkill
- lineage-pii-and-governanceSkill
- lower-environment-data-masking-and-obfuscationSkill
- mainframe-modernization-and-data-offloadSkill
- master-data-and-entity-resolutionSkill
- mcp-data-observability-integrationSkill
- microsoft-purview-and-azure-data-governanceSkill
- notebook-to-production-hardeningSkill
- openmetadata-datahub-and-openlineageSkill
- operational-datastore-selection-relational-and-nosqlSkill
- orchestration-and-backfillsSkill
- pipeline-planning-and-task-breakdownSkill
- privacy-retention-and-right-to-deleteSkill
- python-data-engineering-and-pipeline-packagingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Use this skill when ClickHouse is the target for low-latency analytical serving.
- Distinctive: line 20
Do not use this when the workload is better served by a transactional database or a batch-oriented warehouse with no latency requirement.
- Distinctive: line 41
avoid too many partitions — high partition counts cause merge pressure
- Very specific: line 42
use Buffer tables or async insert when write concurrency is high
- Distinctive: line 48
document the lag between source insert and view availability
- Distinctive: line 49
test that view aggregations remain correct after merges
- Distinctive: line 52
use TTL expressions for automatic partition drops
- Distinctive: line 54
document retention SLA for each table
- Distinctive: line 55
test that TTL does not silently drop data consumers still need
- Distinctive: line 77
no retention or TTL policy on high-volume tables
- Distinctive: line 79
no monitoring of merge backlog or parts count
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ClickHouse Real Time Analytics
Overview
Use this skill when ClickHouse is the target for low-latency analytical serving. It helps agents design ingestion, partitioning, materialized views, and query-ready schemas for fast reads while maintaining operational safety and cost control.
When to Use
- designing or modifying
ClickHousetables for real-time analytics - building event-heavy analytical aggregation layers
- creating materialized views for pre-computed metrics
- optimizing low-latency dashboards and metric APIs
- planning ingestion patterns for high-throughput event streams
Do not use this when the workload is better served by a transactional database or a batch-oriented warehouse with no latency requirement.
Workflow
- Define latency, freshness, and query access patterns.
Include:
- acceptable query latency targets (p50, p99)
- data freshness requirements (seconds, minutes, eventual)
- primary query patterns (point lookups, time-range scans, aggregations)
- expected concurrent query load and user base
- Choose the right table engine and schema design.
MergeTreefamily for most analytical workloadsReplacingMergeTreefor deduplication on eventual consistencyAggregatingMergeTreefor pre-aggregated rollupsCollapsingMergeTreeorVersionedCollapsingMergeTreefor mutable state- define sort keys aligned with primary query filters
- choose partition keys for lifecycle management, not query speed
- Design ingestion for throughput and merge safety.
- batch inserts over single-row writes (target 1000+ rows per insert)
- avoid too many partitions — high partition counts cause merge pressure
- use
Buffertables or async insert when write concurrency is high - define deduplication strategy if at-least-once delivery is the source guarantee
- Build materialized views with explicit contracts.
- materialized views are insert-triggered, not retroactive
- define what happens when the source schema changes
- document the lag between source insert and view availability
- test that view aggregations remain correct after merges
- Plan retention, TTL, and storage tiering.
- use TTL expressions for automatic partition drops
- separate hot and cold storage tiers if cost is a concern
- document retention SLA for each table
- test that TTL does not silently drop data consumers still need
- Make operations observable and recoverable.
- monitor merge backlog, parts count, and replication lag
- alert on query latency degradation and memory pressure
- plan for cluster scaling: shard count, replica count, and rebalancing
- define backup and restore procedures for critical tables
Common Rationalizations
| Rationalization | Reality |
| "ClickHouse is fast so we don't need to optimize schema." | Sort keys, partition choices, and engine selection determine whether queries hit milliseconds or seconds. Speed is designed, not guaranteed. |
| "We can just insert one row at a time." | Single-row inserts cause excessive parts, merge pressure, and eventual degradation. Batching is not optional at scale. |
| "Materialized views handle everything automatically." | Views are insert-triggered and depend on merge behavior. Schema changes, backfills, and retroactive corrections require explicit planning. |
| "Retention is not urgent — storage is cheap." | Unbounded growth increases merge overhead, backup time, and query scan ranges. TTL and lifecycle management are operational requirements. |
Red Flags
- single-row inserts in production without buffering
- partition key chosen for query speed instead of lifecycle management
- materialized views with no documentation of lag or schema change behavior
- no retention or TTL policy on high-volume tables
- sort key does not align with primary query patterns
- no monitoring of merge backlog or parts count
- cluster scaling plan is undefined despite growing data volumes
- backfill strategy assumes materialized views will retroactively process old data
Verification
- Query latency, freshness, and access pattern requirements are documented
- Table engine, sort key, and partition key choices are justified
- Ingestion uses batched writes with explicit deduplication strategy
- Materialized views have documented contracts, lag expectations, and schema change plans
- TTL and retention policies are defined for all high-volume tables
- Operational monitoring covers merge backlog, parts count, replication lag, and query latency
- Scaling and recovery procedures are documented
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

