clickhouse-webhooks-events

Featured

Ingest data into ClickHouse from webhooks, Kafka, and streaming sources with batching, dedup, and exactly-once patterns. Use when building data ingestion pipelines, consuming webhook payloads, or integrating Kafka topics into ClickHouse. Trigger: "clickhouse ingestion", "clickhouse webhook", "clickhouse Kafka", "stream data to clickhouse", "clickhouse data pipeline".

AI & Automation 2,359 stars 334 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# ClickHouse Data Ingestion ## Overview Build data ingestion pipelines into ClickHouse from HTTP webhooks, Kafka, and streaming sources with proper batching, deduplication, and error handling. ## Prerequisites - ClickHouse table with appropriate engine (see `clickhouse-core-workflow-a`) - `@clickhouse/client` connected ## Instructions ### Step 1: Webhook Receiver with Batched Inserts ```typescript import express from 'express'; import { createClient } from '@clickhouse/client'; const client = createClient({ url: process.env.CLICKHOUSE_HOST! }); const app = express(); app.use(express.json()); // Buffer for batching — ClickHouse hates one-row-at-a-time inserts const buffer: Record<string, unknown>[] = []; const BATCH_SIZE = 5_000; const FLUSH_INTERVAL_MS = 5_000; async function flushBuffer() { if (buffer.length === 0) return; const batch = buffer.splice(0, buffer.length); try { await client.insert({ table: 'analytics.events', values: batch, format: 'JSONEachRow', }); console.log(`Flushed ${batch.length} events to ClickHouse`); } catch (err) { console.error('Insert failed, re-queuing:', (err as Error).message); buffer.unshift(...batch); // Put back at front for retry } } // Flush periodically setInterval(flushBuffer, FLUSH_INTERVAL_MS); // Webhook endpoint app.post('/ingest', async (req, res) => { const events = Array.isArray(req.body) ? req.body : [req.body]; for (const event of events) { buffer.push({ ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category