altairsix / eventsource Goto Github PK
View Code? Open in Web Editor NEWServerless Go event sourcing library built on top of dynamodb
Serverless Go event sourcing library built on top of dynamodb
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
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?
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.
Culprit:
Line 187 in 7b6859b
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 err
s of type eventsource.Error
with a Code()
of eventsource.ErrAggregateNotFound
I reckon? --- with all other err
s being properly returned immediately.
@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.
@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?
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.
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?
Comparing between protocol buffer events leads to uncomparrable error with []uint8 arrays.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.