Analytics Service
High-performance event collection service with dual ingestion (HTTP + RabbitMQ), batch writes for efficiency, and topic exchange routing for categorized analytics.
github.com/Danendz/analytics.danendz// tech stack
Go 1.25FiberPostgreSQLRabbitMQGORM
// features
- Dual ingestion: HTTP API + RabbitMQ consumer
- Batch writes: 200 events or 500ms flush interval
- Topic exchange routing: note.*, task.*, user.*, app.*, study.*
- Structured event schema with metadata
- Health check and metrics endpoints
// architecture
Modular Go structure: cmd/api (entry), internal/ (ingest, routes, models, bus, handlers, services). RabbitMQ consumer runs as goroutine alongside Fiber HTTP server. Batch writer accumulates events and flushes on count or timer threshold.