Build a Mini Message Broker
Build a Mini Message Broker in TypeScript: Topics, partitions, offsets and consumer groups in ~100 lines. Readable code with a live playground.
Topics, partitions, offsets and consumer groups in ~100 lines.
Related
- Kafka Lab — Lab
Other builds
- Build Your Own Cache — put(), get(), LRU eviction and TTL expiry.
- Build a Consistent Hash Ring — Virtual nodes and minimal key movement when servers change.
- Build a Retry Mechanism — Exponential backoff with jitter and a retry budget.
- Build a Circuit Breaker — Closed, open and half-open states with a failure threshold.
- Build a Simple Event Bus — Publish/subscribe with isolated subscriber failures.
- Build a Repository — A collection-like interface backed by an in-memory store.
- Build a Unit of Work — Track new, dirty and removed objects; commit them together.
- Build a Simple CQRS System — Commands update a write model; events project read models.