Chronik v0.1.2 Chronik View Source
Chronik is a lightweight EventSourcing/CQRS micro framework for Elixir.
Chronik application is composed of four components:
- The
Chronik.Store
which is an persisted store for domain events. Two adapters are providedChronik.Store.Adapters.Ecto
andChronik.Store.Adapters.ETS
. - The
Chronik.PubSub
which publishes the domain events generated by theChronik.Aggregate
. InChronik
there is only one topic on the PubSub, a stream-all. This provides a global order of the events. Chronik provides a Registry based adapterChronik.PubSub.Adapters.Registry
. - The
Chronik.Aggregate
modules which provides the abstraction of an aggregate. Aggregates receive and validate commands, based on its current state. If the command is accepted a number of domain events are generated and stored and published. Finally the aggregate transition to another states. - The
Chronik.Projection
implements a read model on theChronik.PubSub
. The domain events are processed in order. Missing events are fetch from theChronik.Store
.
Link to this section Summary
Types
A command
in Chronik is a tuple like {:cmd, arg1 arg2}
Domain events can have any form
The id
represents an aggregate id. In principle this can be any
term
Link to this section Types
A command
in Chronik is a tuple like {:cmd, arg1 arg2}
Domain events can have any form.
The id
represents an aggregate id. In principle this can be any
term