GithubHelp home page GithubHelp logo

altairsix / eventsource Goto Github PK

View Code? Open in Web Editor NEW
247.0 247.0 39.0 74 KB

Serverless Go event sourcing library built on top of dynamodb

Go 99.74% Protocol Buffer 0.26%
dynamodb event-sourcing golang serverless

eventsource's People

Contributors

savaki 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eventsource's Issues

Question about Aggregate Validation

I have a question about event-sourcing, how can we validate if the Aggregate can be persisted? Like the example that create a User, how to validate that user has already exists? To restore all the aggregate from event is to expensive. And just check usercreatedevent is also not enough, because user maybe change the username or be deleted. hope you can shed some light on it

licensing info

I'm looking to see if I can use this library in a commercial project. I'm not seeing a license file, are you already releasing it with a license? If not, would you be open to add one?

Save Failed with dynamodb

I get the following error when i try to use the example provided in this git to save into dynamodb

The provided key element does not match the schema [ValidationException]: ValidationException: The provided key element does not match the schema

how can i solve this problem please.

err from loadVersion should not be discarded in Apply

Culprit:

aggregate = r.New()

loadVersion can fail for reasons other than "not found", such as "store implementation has connectivity outage" etc. You do not want to discard such errs and fall back on a newly-instantiated empty aggregate here...

A fix to this would do so only for errs of type eventsource.Error with a Code() of eventsource.ErrAggregateNotFound I reckon? --- with all other errs being properly returned immediately.

prototyping, versioning, and janitorial cleanup

@savaki Hey I hope here is an appropriate place to ask --

Do you have any recommendations or tools in place for cleaning up after prototyping? E.g. removing the S3 archive and DynamoDB tables after testing an application and before switching to "production"?

Also is there anything in place for versioning of the eventstream (e.g. if a schema changes -- or if we want to switch from a staging > production queue)

Thanks! I loved your gopherfest talk and missed out during the q/a.

Questions about streams

@savaki this is more just a question of how you deal with streams using a AWS pipeline. Watching your talk the overall structure makes sense but details are a little fuzzy for someone not engrossed in the AWS stack.

With event stores I've used before you'd have a features such as indexing like in EventStore which can allow for viewing of all events across the system, per aggregate type, or via your own projections using linkTo(streamId, event, metadata).

I know event sourcing and CQRS are orthogonal but how do you deal with the query/projection side after events are written out to Dynamo?

Repo-level transaction ID for aggregate loading

This is mostly a question whether it is in scope and/or if you have thought about this use case.

The API supports loading an aggregate at a particular version of itself, but If I wanted to get the state of two aggregates at some point in time, my understanding is that there is no way of doing this since the version is local to the aggregate. Since Repository.Save takes multiple events which may span multiple aggregates, they are being transactionally saved together (at least conceptually) and thus could/should represent an atomic change in state in the repo.

If there was a repo-level transaction id generated (monotonically increasing) on each call and added to each record, then an aggregate can be loaded relative to the transaction id which means the state of all aggregates in the repo could be loaded with respect to some point in time. At that point you could get a copy of the repo "as of" some transaction (or time).

// Initialize.
r := eventsource.New(...)

// Perform 10 calls to r.Save() so tx = 10 by the end

// Get the repo as-of transaction 5.
r5 := r.Asof(5)

bobAt5 := r5.Load(ctx, "bob")
bob := r.Load(ctx, "bob")

A timestamp could be associated with each transaction id so Asof could be a real time.Time rather than the transaction id or AsofT for txid and Asof for time.

gopherfest example does not work

Watch the talk and tried to run the gopherfest example, unfortunately got the error file: 'github.com/altairsix/eventsource/_examples/gopherfest/main.go' severity: 'Error' message: 'undefined: eventsource.NewDispatcher' at: '98,2' source: ''

Has the examples been checked for the against the latest revisions?

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.