π¦ buzzard
A lightweight, DDD-first message bus framework for Rust β orchestrate commands, events, and projections with confidence.
buzzard is a strongly typed, domain-driven orchestration framework for message-based applications in Rust. Inspired by hexagonal and DDD patterns, it lets you model business flows with explicit Command, Event, and Projection types while remaining infrastructure-agnostic.
β¨ Features
- π§ Domain-driven: Clean separation of Commands, Events, and Projections
- π Fully asynchronous and
Send + Sync + Clonesafe - π¦ Broker-agnostic (
Redis,Postgres,NATS, etc.) - π§± Extensible via
MessageBusDriver,CommandHandler,Policy, andProjector - π Easy to integrate into web servers, CLI apps, and background workers
π¦ Quickstart Example
async
π§ Message Flow
ββββββββββββββββββββββββββ
β Message Bus β
ββββββββββββββ¬ββββββββββββ
β
ββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββ βββββββββββββββββββββββ ββββββββββββββββββββββ
β Command Msg β β Event Msg β β Projection Msg β
ββββββββ¬βββββββββ βββββββββββ¬ββββββββββββ ββββββββββββ¬ββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββββββββ
β CommandHandlerβ β Policy β β Projector β
ββββββββ¬βββββββββ ββββββββββ¬ββββββββββββ βββββββββββββ¬βββββββββββββ
β domain mutation β maps event to side effects β
βΌ βΌ β
ββββββββββββββββββββββ ββββββββββββββββββββββββββββββ β
β UnitOfWork β β Vec<SideEffect<Cmd, Proj>> β β
β - apply mutations β βββββββββββββββ¬βββββββββββββββ β
β - capture events β β β
β - commit/rollback β β β
βββββββββββ¬βββββββββββ β β
β commits β publishes β
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
β Event Msg(s) βββββββββΊβ Message Bus (loopback) β β Projection Msgs from Policy β
ββββββββββββββββ ββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
π Traits You Implement
| Trait | Description |
|---|---|
MessageBusDriver |
Declares domain types + infrastructure |
CommandHandler |
Executes domain logic with mutation |
Policy |
Reacts to events with follow-up messages |
Projector |
Handles read model and infra updates |
π Lifecycle Summary
dispatch(command)β handled inUnitOfWork- Domain events are emitted and published
- Events trigger
Policylogic β follow-up messages - Messages include new commands or projections
- Projections handled by external-side
Projector
β When to Use
- You want a clean, extensible message-processing runtime
- You use DDD / CQRS and want to model each message explicitly
- You want to test your business logic independently of infrastructure
π Built With
futures,anyhow- Your backend: PostgreSQL, Redis, NATS, MeiliSearch...