looplab / Eventhorizon
Programming Languages
Projects that are alternatives of or similar to Eventhorizon
Event Horizon
Event Horizon is a CQRS/ES toolkit for Go.
NOTE: Event Horizon is used in production systems but the API is not final!
CQRS stands for Command Query Responsibility Segregation and is a technique where object access (the Query part) and modification (the Command part) are separated from each other. This helps in designing complex data models where the actions can be totally independent from the data output.
ES stands for Event Sourcing and is a technique where all events that have happened in a system are recorded, and all future actions are based on the events instead of a single data model. The main benefit of adding Event Sourcing is traceability of changes which can be used for example in audit logging. Additionally, "incorrect" events that happened in the past (for example due to a bug) can be compensated for with an event which will make the current data "correct", as that is based on the events.
Read more about CQRS/ES from one of the major authors/contributors on the subject: http://codebetter.com/gregyoung/2010/02/16/cqrs-task-based-uis-event-sourcing-agh/
Other material on CQRS/ES:
- http://martinfowler.com/bliki/CQRS.html
- http://cqrs.nu
- https://groups.google.com/forum/#!forum/dddcqrs
Inspired by the following libraries/examples:
- https://github.com/edumentab/cqrs-starter-kit
- https://github.com/pjvds/go-cqrs
- http://www.codeproject.com/Articles/555855/Introduction-to-CQRS
- https://github.com/qandidate-labs/broadway
Suggestions are welcome!
Usage
See the example folder for a few examples to get you started.
Storage implementations
Official
- Local / in memory
- MongoDB (beware of the 16MB document size limit that can affect large aggregates)
Contributions / 3rd party
- AWS DynamoDB: https://github.com/seedboxtech/eh-dynamo
- MongoDB-DPE (supporting larger aggregates): https://github.com/gjongenelen/eh-mongodb
- Postgress: https://github.com/giautm/eh-pg
- Redis: https://github.com/TerraSkye/eh-redis
Event Bus Implementations
Official
- GCP Cloud Pub/Sub
- Jetstream (NATS), uses nightly build of NATS/Jetstream
- Kafka
- Local / in memory, useful for testing/experimentation.
- Redis
Contributions / 3rd party
- Kafka: https://github.com/Kistler-Group/eh-kafka
- NATS Streaming: https://github.com/v0id3r/eh-nats
Development
To develop Event Horizon you need to have Docker and Docker Compose installed.
To run all unit tests:
make test
To run and stop services for integration tests:
make run
make stop
To run all integration tests:
make test_integration
Testing can also be done in docker:
make test_docker
make test_integration_docker
Get Involved
- Join our slack channel (sign up here)
- Check out the contribution guidelines
License
Event Horizon is licensed under Apache License 2.0