• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

looplab/eventhorizon: Event Sourcing for Go!

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

looplab/eventhorizon

开源软件地址:

https://github.com/looplab/eventhorizon

开源编程语言:

Go 99.7%

开源软件介绍:

PkgGoDev Build Status Coverage Status Go Report Card

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:

Inspired by the following libraries/examples:

Suggestions are welcome!

Usage

See the example folder for a few examples to get you started.

Get Involved

Event Store Implementations

Official

  • Memory - Useful for testing and experimentation.
  • MongoDB - One document per aggregate with events as an array. Beware of the 16MB document size limit that can affect large aggregates.
  • MongoDB v2 - One document per event with an additional document per aggregate. This event store is also capable of keeping track of the global event position, in addition to the aggregate version.
  • Recorder - An event recorder (middleware) that can be used in tests to capture some events.
  • Tracing - Adds distributed tracing support to event store operations with OpenTracing.

Contributions / 3rd party

Event Bus Implementations

Official

  • GCP Cloud Pub/Sub - Using one topic with multiple subscribers.
  • NATS - Using Jetstream features.
  • Kafka - Using one topic with multiple consumer groups.
  • Local - Useful for testing and experimentation.
  • Redis - Using Redis streams.
  • Tracing - Adds distributed tracing support to event publishing and handling with OpenTracing.

Contributions / 3rd party

Repo Implementations

Official

  • Memory - Useful for testing and experimentation.
  • MongoDB - One document per projected entity.
  • Version - Adds support for reading a specific version of an entity from an underlying repo.
  • Cache - Adds support for in-memory caching of entities from an underlying repo.
  • Tracing - Adds distributed tracing support to an repo operations with OpenTracing.

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

License

Event Horizon is licensed under Apache License 2.0

http://www.apache.org/licenses/LICENSE-2.0




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap