eventhorizon icon indicating copy to clipboard operation
eventhorizon copied to clipboard

[eventstore] Async EventStore for Kafka

Open mumia opened this issue 8 years ago • 5 comments

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.

mumia avatar Oct 02 '17 22:10 mumia

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.

maxekman avatar Oct 03 '17 09:10 maxekman

@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.

mumia avatar Oct 03 '17 09:10 mumia

Sounds really good, looking forward to see it!

maxekman avatar Oct 07 '17 00:10 maxekman

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

bweston92 avatar Feb 27 '18 15:02 bweston92

Any updates on this?

chriskolenko avatar Mar 25 '18 21:03 chriskolenko