Cue
Cue is a distributed, in-memory job queue with Raft-based consistency, automatic retries, and dead letter handling.
Cue is for teams who need reliable job dispatch without operating complex infrastructure. It's not a Kafka replacement - it's an honest, bounded, operationally simple alternative for teams that need durable, retrying job queues.
β οΈ Cue is a distributed system. A single node has no durability. For production, run 3, 5, or 7 nodes. CueProxy is the companion gateway - see cue-proxy.

Table of Contents
Docs
read the full docs here.
Related Project:
- CueProxy - The stateless HTTP/WebSocket gateway
How It Works
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cue Cluster β
β β
β βββββββββββββββ βββββββββββββββ ββββββββββββ
β β Leader β β Follower β βFollower ββ
β β node1 β β node2 β β node3 ββ
β β β β β β ββ
β β βββββββββββ β β βββββββββββ β ββββββββββββ
β β βPartitionβ β β βPartitionβ β ββPartit.βββ
β β β A β β β β A β β ββ A βββ
β β β B β β β β B β β ββ B βββ
β β β C β β β β C β β ββ C βββ
β β βββββββββββ β β βββββββββββ β ββββββββββββ
β β WAL β β WAL β β WAL ββ
β βββββββββββββββ βββββββββββββββ ββββββββββββ
β β² β² β² β
β ββββββββββββββββββ΄βββββββββββββββ β
β Raft Replication β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
QUIC β QUIC
βββββββββββββββββββββββΌββββββββββββββββββββββ
β β β
βββββββΌββββββ βββββββΌββββββ ββββββΌβββββ
β CueProxy β β CueProxy β βCueProxy β
β Instance β β Instance β βInstance β
βββββββββββββ βββββββββββββ βββββββββββ
All nodes are identical - every node has the same set of partitions (topics). Raft keeps them in sync:
- Leader: Accepts writes, replicates to followers, dispatches jobs to proxies
- Followers: Receive replicated commands via Raft, apply to local partitions
Partitions are internal - each topic is a separate partition with its own:
- In-memory job queue
- Retry scheduler
- Dead Letter Queue
- Consumer state tracking
All nodes see the same state - Raft ensures every command (add job, done, drop) is applied identically on all nodes. If the leader has 3 topics (A, B, C), all followers have the exact same 3 topics with the same jobs.
Cue cluster nodes communicate via QUIC with mTLS authentication. Each node runs:
- Raft consensus - for leader election and command replication
- Partition manager - each topic is a separate in-memory partition
- WAL - Write-Ahead Log for durability and recovery
- QUIC gateway - accepts connections from CueProxy instances
The flow:
- Producers submit jobs via CueProxy
- The Cue cluster leader persists jobs to Raft WAL and memory
- The leader dispatches jobs to proxies with consumers for that topic
- Consumers acknowledge completion via proxy
- The leader removes completed jobs from memory
Consistency:
- All writes go through the leader
- Raft ensures linearizable consistency
- WAL provides durability across restarts
- Snapshots prevent log growth
Resilience:
- Automatic leader election on failure
- Jobs survive leader crashes (WAL replay on restart)
- Retries with exponential backoff
- Dead Letter Queue for failed jobs
Key Features
ποΈ Raft-Based Consistency
No split-brain. No data loss. Raft consensus ensures all nodes agree on state.
πΎ Durable by Default
Write-Ahead Log persists every command. Crashes and restarts replay the WAL.
π Automatic Retries
Jobs retry with exponential backoff (configurable). Max retries and backoff limits prevent infinite loops.
π Dead Letter Queue
Failed jobs go to DLQ with configurable retention (size and age limits).
π¦ In-Memory Partitions
One partition per topic. Fast, bounded, predictable. No disk I/O for job dispatch.
π Secure QUIC Communication
mTLS between cluster nodes. TLS between cluster and proxies. Configurable certificate verification.
π Built-in Monitoring
Prometheus metrics for partitions, cluster, and gateway.
Limitations
Cue is designed to be honest about its limits:
- In-memory only: Jobs are stored in memory. Raft WAL provides durability across restarts, but total capacity is bounded by available RAM.
- Bounded queues: Configurable
active_queue_capacity per topic (default: 1,000,000). Exceeding this returns "queue full" errors.
- No replay: Once acknowledged, jobs are removed from memory. No historical replay.
- Leader-dependent writes: All write operations go through the leader. Followers are read-only.
- Throughput: Limited by leader's memory, Raft consensus speed, and network latency.
- No SQL/query: Jobs are opaque byte arrays. No filtering or searching.
Cue is not for:
- Large-scale persistent streaming (use Kafka)
- Fire-and-forget pub/sub (use Redis)
- Long-term job storage (use a database)
- Complex job dependencies (use a workflow engine)
Cue is for:
- Teams needing reliable job dispatch without complex ops
- At-least-once delivery with automatic retries
- Simple, bounded, predictable job queues
- Internal microservices communication
Contributing
Contributions are welcome! Please read the contributing guide for details.
License
MIT License - see LICENSE for details.