Skip to main content

Managed ClickHouse

Okustera Managed ClickHouse delivers enterprise-grade, high-throughput columnar analytical OLAP (Online Analytical Processing) storage powered by ClickHouse 24.3.

ClickHouse is a column-oriented database management system designed for real-time analytical reporting, distributed log inspection, time-series telemetry, and AI/application observability tracing. By storing data by columns rather than rows and leveraging vectorized SIMD CPU execution, ClickHouse processes analytical queries up to 100x to 1,000x faster than traditional row-oriented relational databases.

In Okustera, ClickHouse clusters are fully managed and backed by replicated NVMe block storage, coordinated by ClickHouse Keeper, and protected with zero-trust private network boundaries and automated password escrow via Okustera Key Management Service (KMS).


Architectural Highlights​

Key Capabilities​

  • Columnar Vectorized Engine: Reads only the columns requested in the query, achieving compression ratios of 4x to 10x with ZSTD/LZ4 and scanning billions of rows per second per server.
  • Managed Lifecycle Orchestration: Automated shard scaling, replica provisioning, rolling minor updates, and configuration management via the Okustera Portal, REST API, or Terraform.
  • ClickHouse Keeper Consensus: Lightweight, embedded Raft-based coordination for table replication (ReplicatedMergeTree) and distributed DDL (ON CLUSTER), eliminating the operational complexity of external ZooKeeper clusters.
  • NVMe Block Persistence: Data directories are backed by dedicated high-IOPS NVMe block volumes with crash-consistent snapshot support.
  • Zero-Trust Private Endpoints: Cluster endpoints are exposed exclusively on private tenant networks (:8123 HTTP REST, :9000 Native TCP). Public ingress is disabled by default so analytical data and telemetry never traverse unencrypted public routes.
  • KMS Password Escrow: Administrative database passwords are automatically generated, encrypted, and vaulted in Okustera KMS.
  • S3 Cold Storage Offload: Seamless integration with Okustera S3 Object Storage via ClickHouse storage policies for tiered data aging, automatically archiving historical partition parts to object storage.

Provisioning via Okustera Portal & REST API​

Portal Cloud Console​

  1. Navigate to Database Services (DBaaS) in the Okustera Portal.
  2. Select the ClickHouse OLAP tab or click Create Database Cluster and select ClickHouse 24.3.
  3. Specify your cluster name, tenant namespace, node replicas, and NVMe storage allocation (default: 10 GiB).
  4. Click Create Database Cluster. Your private HTTP endpoint (http://<clickhouse-endpoint>:8123), Native TCP endpoint (port 9000), and connection URI will be displayed with one-click copy and secret visibility controls.

REST API Example​

curl -X POST "https://portal.okustera.com/api/v1/dbaas/clickhouse" \
-H "Authorization: Bearer ${OKUSTERA_API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "telemetry-analytics",
"namespace": "production",
"version": "24.3",
"replicas": 2,
"storage_size": "20Gi"
}'

Response (201 Created):

{
"id": "telemetry-analytics",
"name": "telemetry-analytics",
"namespace": "production",
"engine": "clickhouse",
"engine_version": "24.3",
"status": "Creating",
"replicas": 2,
"storage_size": "20Gi",
"service_endpoint": "http://<clickhouse-endpoint>:8123",
"connection_uri": "clickhouse://default:<PASSWORD>@<clickhouse-endpoint>:9000/default"
}

Provisioning with Terraform​

Manage ClickHouse clusters declaratively using the official Okustera Terraform provider:

resource "okustera_database_clickhouse" "telemetry_analytics" {
name = "telemetry-analytics"
namespace = "production"
version = "24.3"
replicas = 2
storage_size = "100Gi"
}

output "clickhouse_http_endpoint" {
value = okustera_database_clickhouse.telemetry_analytics.service_endpoint
}

output "clickhouse_connection_uri" {
value = okustera_database_clickhouse.telemetry_analytics.connection_uri
sensitive = true
}

Refer to the Terraform Resource Reference for complete schema documentation.


Connecting from Python (clickhouse-connect)​

Applications and data pipelines connect over the high-speed HTTP REST API port (8123) or Native TCP (9000):

import os
import clickhouse_connect

# Connect to ClickHouse via private endpoint
client = clickhouse_connect.get_client(
host=os.environ.get("CLICKHOUSE_HOST", "<clickhouse-endpoint>"),
port=8123,
username="default",
password=os.environ.get("CLICKHOUSE_PASSWORD"),
database="default",
)

# Create an analytical events table with MergeTree engine
client.command("""
CREATE TABLE IF NOT EXISTS api_request_events (
timestamp DateTime64(3, 'UTC'),
request_id UUID,
tenant_id LowCardinality(String),
route LowCardinality(String),
status_code UInt16,
duration_ms Float32,
prompt_tokens UInt32,
completion_tokens UInt32
) ENGINE = MergeTree()
PARTITION BY toYYYYMM(timestamp)
ORDER BY (tenant_id, route, timestamp)
""")

# High-throughput batch insertion
events_data = [
[
"2026-10-04 10:00:00.123",
"a1b2c3d4-e5f6-7a8b-9c0d-1e2f3a4b5c6d",
"tenant-alpha",
"/v1/chat/completions",
200,
142.5,
512,
128,
],
]

client.insert(
"api_request_events",
events_data,
column_names=[
"timestamp",
"request_id",
"tenant_id",
"route",
"status_code",
"duration_ms",
"prompt_tokens",
"completion_tokens",
],
)

# Run vectorized real-time aggregation
result = client.query("""
SELECT
tenant_id,
count() AS total_requests,
avg(duration_ms) AS p50_duration,
sum(prompt_tokens + completion_tokens) AS total_tokens
FROM api_request_events
WHERE timestamp >= now() - INTERVAL 1 HOUR
GROUP BY tenant_id
ORDER BY total_tokens DESC
""")

for row in result.result_rows:
print(f"Tenant: {row[0]} | Requests: {row[1]} | Avg Latency: {row[2]:.2f}ms | Tokens: {row[3]}")

Connecting via cURL / HTTP Query Interface​

The ClickHouse HTTP interface enables straightforward queries from scripts and health monitors:

# Query server version and current database
curl -s "http://<clickhouse-endpoint>:8123/?query=SELECT%20version(),current_database()" \
-H "X-ClickHouse-User: default" \
-H "X-ClickHouse-Key: ${CLICKHOUSE_PASSWORD}"

# Execute an arbitrary SQL query returning JSONCompact
curl -s -X POST "http://<clickhouse-endpoint>:8123/" \
-H "X-ClickHouse-User: default" \
-H "X-ClickHouse-Key: ${CLICKHOUSE_PASSWORD}" \
--data-binary "SELECT count(), avg(duration_ms) FROM api_request_events FORMAT JSONCompact"

Technical Specifications​

ParameterSpecification
EngineClickHouse Columnar OLAP (24.3)
CoordinationClickHouse Keeper (Raft consensus)
PersistenceReplicated NVMe Block Storage
HTTP REST PortTCP 8123
Native TCP PortTCP 9000
Inter-Server PortTCP 9009
Network ExposurePrivate tenant network (Zero-Trust isolated)
Public IngressNone (internal traffic only)
AuthenticationPassword automatically vaulted in Okustera KMS
Table EnginesMergeTree, ReplicatedMergeTree, SummingMergeTree, AggregatingMergeTree
Common WorkloadsReal-time analytics, log aggregation, time-series telemetry, observability tracing