Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eventstore] Async EventStore for Kafka #163

Open
mumia opened this issue Oct 2, 2017 · 5 comments
Open

[eventstore] Async EventStore for Kafka #163

mumia opened this issue Oct 2, 2017 · 5 comments

Comments

@mumia
Copy link

mumia commented Oct 2, 2017

Was wondering if anyone has wrangled with implementing an asynchronous EventStore to user with Kafka and other store engines?

Could we implement some version of the event store that would return some type of promise object and allow for error/success handling?

type AsyncEventStore interface {
	// Save appends all events in the event stream to the store.
	Save(ctx context.Context, events []Event, originalVersion int) chan<- error

	// Load loads all events for the aggregate id from the store.
	Load(context.Context, UUID) (chan<- []Event, chan<- error)
}

Food for thought.
Comments welcome.

Will try to implement something.

@maxekman
Copy link
Member

maxekman commented Oct 3, 2017

It does sound interesting!

Is there a possibility to wait for the event to be written inside your implementation? It is important that the EventStore.Save() method fully saves the event and increments the version atomically, otherwise there will be no guarantee that the command was successful.

@mumia
Copy link
Author

mumia commented Oct 3, 2017

@maxekman Yes, when I woke up today I realised that I could use the async write inside the EventStore.Save.
This way we use efficient and reliable writes in kafka and don't break the current implementation of the Store.
Will implement something and open a PR for you to check.

@maxekman
Copy link
Member

maxekman commented Oct 7, 2017

Sounds really good, looking forward to see it!

@bweston92
Copy link

Hi @mumia sounds interesting, anything that we can help with?

@maxekman maxekman changed the title Async EventStore for Kafka [eventstore] Async EventStore for Kafka Mar 21, 2018
@chriskolenko
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants