CQRS Eventsourcing Workflow Engine
Only the data structures are working, for testing and collecting feedbacks. We believe that at the begining of December 2016, the framework will be usable.
Pure functions data structures
In the folder engine > types you will find the data structures, so you can write your pure functions over them, under the "side effects" dimension.
- A pure function is given one or more input parameters.
- Its result is based solely off of those parameters and its algorithm. The algorithm will not be based on any hidden state in the class or object it’s contained in.
- It won’t mutate the parameters it’s given.
- It won’t mutate the state of its class or object.
- It doesn’t perform any I/O operations, such as reading from disk, writing to disk, prompting for input, or reading input.
As aggregates listen for commands, process managers listen for events (sometimes commands also), and as aggregates emmits events, process managers dispatch commands.
- pure functional data structures for aggregates and process managers
- use monads (monadex) to simulate different business scenarios
- one abstraction to implement side-effects
- multiple data-stores
- plugable message queue for publishing events
- one gen_server implementation for aggregates and process managers
- automatic process-manager creation based on correlation-ids (as suggested by Greg Young)
- easy use of FSM on process managers
Send events from the prompt:
iex -S mix TODO: add example
docker run --name eventstore-node -it -p 2113:2113 -p 1113:1113 eventstore/eventstore
Below you can see several resources I researched before writing this lib. Special thanks for Ben Smith, where many ideas were copied from commanded library.
- burmajam for sharing the very well written extreme driver to connect to Eventstore.
- slashdotdash for sharing the CQRS framework, where many parts of the code here are from his framework.
- cqrs-erlang - A memory model using standard spawn functions CQRS in erlang.
- gen-aggregate - Macro for the aggregate structure, using buffers.