This document provides a high-level introduction to cursus, a lightweight message broker system.
It covers the system’s purpose, core components, and architectural design. For detailed information about specific subsystems, see Architecture Overview and Core Systems.
For setup instructions, see Getting Started.
cursus is a lightweight message broker inspired by Kafka’s design philosophy of logically separated but physically distributed data management.
It provides publish-subscribe messaging with topic partitioning, consumer groups, and durable disk persistence, designed for single-node deployments with minimal operational complexity.
cursus exposes three network ports, each serving a distinct purpose:
| Port | Protocol | Handler | Purpose |
|---|---|---|---|
| 9000 | TCP | server.RunServer() |
Main broker operations (PUBLISH, CONSUME, CREATE, etc.) |
| 9080 | HTTP | startHealthCheckServer() |
Health check endpoint for load balancers |
| 9100 | HTTP | metrics.StartMetricsServer() |
Prometheus metrics exporter |
TopicManager.Publish() checks dedupMap using message ID (hash of payload) to prevent duplicate processing within 30 minutesTopic.Publish() uses key-based hashing for ordered delivery or round-robin counter for load balancingPartition.Enqueue() sends to both disk (via DiskHandler) and consumer channelsMessages are persisted using a segment-based append-only log architecture
Each topic-partition pair gets its own DiskHandler instance:
flushLoop() goroutinemmap(memory-mapped I/O) for readsThis architecture enables parallel I/O across partitions and efficient sequential reads. For detailed persistence mechanics, see Disk Persistence System.