Back to projects

Systems / Analytics prototype

AppTrack

A multi-language event collection system: HTTP and UDP ingestion in Go, Kafka transport, and a ClickHouse consumer with column-oriented event storage.

GoKafkaClickHouseHTTP / UDP
View repository
APPTRACK
SDK EVENTS → KAFKA → CLICKHOUSE

01 / COMPONENTS & DATA FLOW

Inside the system.

  1. 01JS / Go / Python SDK
  2. 02Go collector
  3. 03Kafka topic
  4. 04ClickHouse events

Two ingestion transports

The collector accepts JSON at POST /api/v1/event and also listens for UDP datagrams. Missing event IDs and timestamps are filled with UUIDs and Unix milliseconds.

Kafka transport

Events are serialized into the uamt-events topic through kafka-go. The consumer reads that topic with the clickhouse-consumer group and maps records into an events insert.

Analytical storage

The ClickHouse events table uses MergeTree ordered by timestamp and event_type. A separate users table uses ReplacingMergeTree with updated_at as its version column.

02 / IMPLEMENTATION DECISIONS

Why it works this way.

Fast acknowledgment is not durable acknowledgment

The HTTP collector responds 202 Accepted after launching a goroutine to publish the event. A later Kafka write failure is logged, so the acknowledgment does not prove durable delivery.

Storage is explicit and inspectable

The schema separates event identity, session, event type, JSON metadata, and system attributes. The current consumer executes one insert per event rather than batching writes.

03 / SCOPE & TRADEOFFS

The implementation boundary.

The repositories establish an ingestion architecture. Durable acknowledgments, insertion batching, and replay/deduplication guarantees would require further work before claiming production-grade delivery.

04 / READ THE IMPLEMENTATION

Follow it into the code.