Chronik v0.1.11 Chronik View Source
A lightweight EventSourcing/CQRS micro framework for Elixir.
Chronik
is composed of four components:
The
Chronik.Store
which is an persisted data store for domain events. Two adapters are provided:Chronik.Store.Adapters.Ecto
Chronik.Store.Adapters.ETS
The
Chronik.PubSub
which publishes the domain events generated byChronik.Aggregate
. InChronik
there is only one topic on the PubSub: a stream-all. This provides a global order of the events. Chronik provides aRegistry
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, stored and published. Finally, the aggregate transitions to the next desirable state.The
Chronik.Projection
implements a read model on theChronik.PubSub
. The domain events are processed in order. Missing events are fetch fromChronik.Store
.
Debugging can be turned off by placing the following in a config script:
config :chronik, :debug, false
Link to this section Summary
Types
A command
in Chronik is a 3 element tuple with the following
format: {:cmd, arg1 arg2}
Domain events can have any shape
The id
represents an aggregate identifier
Link to this section Types
A command
in Chronik is a 3 element tuple with the following
format: {:cmd, arg1 arg2}
Domain events can have any shape
The id
represents an aggregate identifier