GithubHelp home page GithubHelp logo

get-eventually / go-eventually Goto Github PK

View Code? Open in Web Editor NEW
85.0 85.0 4.0 818 KB

Idiomatic Domain-driven Design, CQRS and Event Sourcing for Go

License: MIT License

Go 96.29% PLpgSQL 3.34% Makefile 0.37%
cqrs cqrs-es ddd domain-driven-design event-sourcing go golang golang-library

go-eventually's People

Contributors

ar3s3ru avatar bretanac93 avatar dependabot[bot] avatar evgeniylugin avatar github-actions[bot] avatar kostassoid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

go-eventually's Issues

feat: centralize Event Registry

Due to the current limitations of Go, the postgres implementation of the Event Store needs an Event Register to be able to deserialize events from the remote storage into a Go object.

However, this concern is somewhat general to any possibleEvent Store implementation. We can then extract this piece of code in a separate module.

Add support for Snapshots

Context and problem statement

Aggregate Roots are typically "small", where the number of Domain Events registered for each AR is in the order of 100-1000.

In such cases, there is no problem rebuilding the state of an AR by the beginning of its Event Stream, as pulling ~1000 events back into the application should still be pretty efficient.

However, there are cases where an AR can record a pretty high number of Domain Events, reaching a point where replaying the Event Stream from the very beginning each time can become a performance bottleneck.

Solution

To alleviate this issue, we can use a Snapshot, which contains the state of the AR at a specific point. Snapshots can be used as a starting point for the AR rehydration to reduce the number of Events that need to be replayed from the Event Stream in the Event Store.

Make eventstore/postgres return eventstore.ErrConflict

Currently, the eventstore/postgres implementation does not return a value of ErrConflict if there is a optimistic concurrency error: the exception is only raised on the pSQL code and not adapted to the Go error type.

This means that any error handling code based upon eventstore.ErrConflict won't work.

Move to submodules structure

Instead of having a single eventually-go module with all dependencies, it might be a better idea to split functionalities in submodules to limit the number of indirect depedencies pulled from packages requiring eventually-go.

refactor: remove Subscriber interface

The eventstore.Subscriber interface is used to support push semantics of Event Processors: new Events are pushed from the Event Store to the Processor, similar to Pub/Sub approach.

Push semantics is not always supported by all the event streaming technologies out there, and generally speaking event streaming platforms prefer pull semantics instead (currently supported by the eventstore.Streamer interface).

We can remove any trace of this interface from the codebase for v0.1.0, and only rely on pull semantics. This makes things harder for Volatile Subscriptions, but we could add some support for the Stream* methods to fetch events from the latest one available.

chore: add Github Actions to automate versioning release

I hate manual tagging because, as everything tasked to a human being, the human factor brings inherent error.

Since we're all ✨ software engineers here ✨ we can automate the tagging process when merging on main -- maybe after the tests have passed?

NOTE: for each feature, a minor release should be used, and fix or minor branch, a patch release should be used instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.