posse
Version, currently master branch1 version
- master branchlatestJul 30, 2026
github.com/posse-framework/posse
A light, type-safe CQRS and event sourcing framework
Installation
# Add this to your shard.yml
dependencies:
posse:
github: posse-framework/posse
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.18.2- License
- MIT
- Author
- Giorgi Kavrelishvili
Dependencies
Development Dependencies
- ameba*github: crystal-ameba/amebadev
README
Posse is a framework for building event-sourced, domain-driven applications. It is designed to be modular, type-safe, and capable of scaling up to the performance limits of the Crystal programming language. Heavily inspired by Elixir's Commanded, Posse offers fine-grained surgical consistency controls, actor-like fiber concurrency, and bulletproof event logs with zero operational bloat.
Motivation
This project exists due to the fact that typical event-sourcing setups lack rigid architecture and structural patterns in Crystal, while maintaining maximum hardware performance without asynchronous bottlenecks.
Features
- Blazing fast performance leveraging Crystal's compiled native runtime and lightweight fibers.
- Surgical consistency control (
Wait[Class]) allowing dynamic synchronization at the call site. - Expressive and type-safe domain modeling for Routers, Aggregates, Projectors, and Sagas.
- Fiber-safe concurrency built natively on thread-safe primitives, mutexes, and channels.
- Zero operational bloat with modular architecture inspired by Elixir's Commanded.
Code example
Add this to your application's router and domain models:
module Untitled
class Router
include Posse::Commands::Router
event_store Posse::EventStore::InMemory
use Behaviors::Untitled
dispatch [Commands::RegisterUser, Commands::ChangeUserFirstName, Commands::SendWelcome],
to: Aggregates::User,
identity: id
end
end
module Untitled
module Projectors
class User
include Posse::Projectors::Projector
store Posse::Projectors::Stores::InMemory
project Events::UserRegistered do |event, _metadata, multi|
projection = Projections::User.new(
id: event.id, first_name: event.first_name, last_name: event.last_name,
email: event.email, password: event.password
)
multi.insert("user:#{event.id}", Posse::Value.new(projection))
end
end
end
end
module Untitled
module ProcessManagers
class Welcome
include Posse::ProcessManagers::ProcessManager
router Untitled::Router
store Posse::Projectors::Stores::InMemory
react Events::UserRegistered do |event, _metadata, router|
router.dispatch(
Commands::SendWelcome.new(id: event.id, email: event.email),
consistency: Posse::Commands::Consistency::Kind::Strong
)
end
end
end
end
To dispatch commands with surgical consistency:
id = UUID.random.to_s
register_command = Untitled::Commands::RegisterUser.new(
id: id,
first_name: "John",
last_name: "Doe",
email: "john@doe.com",
password: "Abcd1234!@#$"
)
Untitled::Router.dispatch(
register_command,
consistency: Posse::Commands::Consistency::Wait[Untitled::ProcessManagers::Welcome]
)
Installation
Add this to your application's shards.yml:
dependencies:
posse:
github: posse-framework/posse
And run this command in your terminal:
shards install
Contribute
See our contribution guidelines and read the code of conduct.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Jul 30, 2026
- Crystal
>= 1.18.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/posse-framework/posse
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 1