Single-node · In-memory · gRPC

Heads up: I ended up switching to NATS + PostgreSQL. If you need consumer groups, bare NATS won't help — you need JetStream, which requires persistence. tinybroker fills the gap when you want in-memory consumer groups with no persistence overhead. The code works and is free to use; just know why you're reaching for it.

tinybroker is a single-node, in-memory message broker over gRPC. No clustering, no persistence, no operational complexity.

When to reach for it: you have a small fleet of replicated services that need pub/sub fan-out, lightweight coordination, or task broadcasting — but standing up Kafka, Pulsar, NATS JetStream, or RabbitMQ is disproportionate. tinybroker starts in milliseconds, uses negligible memory at rest, and disappears cleanly when your service does.

Quick start

docker run -p 50051:50051 -p 8080:8080 -p 9090:9090 phughk/tinybroker:latest

Or download the compose file and run docker compose up.

PortPurpose
50051gRPC API
8080Health — GET /health, GET /ready
9090Prometheus metrics — GET /metrics

Features

gRPC API

RPCTypeDescription
PublishUnaryPublish a message to a named topic
SubscribeBidirectional streamSend pattern commands, receive message events
GetTopicsUnaryList known topics with an optional glob filter
RemoveSubscriptionUnaryClose a subscription by ID
AckUnaryAcknowledge a message (no-op in fan-out mode)

Full proto definitions: proto/tinybroker/v1/

Configuration

{
  bind: {
    grpc:    "[::]:50051",
    health:  "[::]:8080",
    metrics: "[::]:9090",
  },
  channel: {
    command_capacity:  100,  // all broker commands + publishes
    consumer_capacity: 100,  // per-subscriber delivery buffer
    event_capacity:     64,  // per-subscriber gRPC response buffer
  },
  log: { format: "text" },  // "text" or "json"
}

CLI flags take precedence: --grpc-bind, --health-bind, --metrics-bind, --config