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
Multiple Database support + Auto-snapshot saving and replay #37
Comments
The individual storage adapters can be wrapped with if Code.ensure_loaded?(EventStore) do
# ... `eventstore` provider
end
if Code.ensure_loaded?(Extreme) do
# ... `extreme` provider
end |
Auto-snapshotting should be implemented as a separate feature from the storage abstraction. Since snapshotting can be run as a background activity. Completely separate from persisting events for an aggregate. This also ensures that there won't be increased latency on aggregate operations because a snapshot is also being recorded. See #27. |
Ok, got it, good design :) I will continue with the database layer, with the contracts, and leave snapshots for the end. Let's avoid early optimizations. I also thought about a "persistence" layer that could receive aggregates and process managers data structures, replay them and send them back, using closures. So I call the closure callback injected the read events from db. The idea is to have a testable, abstract and unique place to persist and rehydrate states for all the application, @slashdotdash makes sense ? |
Hello @henry-hz, @slashdotdash maybe this could be useful to you, I have a fork at https://github.com/sharksdontfly/commanded/tree/eventstore-behaviour which integrates geteventstore.com (via extreme). Event store usage in commanded is replaced by a behaviour. It has one limitation though, when using Additionally there is a module which one can
|
@sharksdontfly Wow. That's an awesome chunk work of work you've done to integrate Greg's event store. Are you interested in submitting a pull request to merge the changes back in once you're done? That would help out @henry-hz too. |
@sharksdontfly wow! |
Done by #55. |
Port this idea to commanded: https://github.com/work-capital/engine/blob/develop/lib/engine/storage/storage.ex
Let me suggest to have a "storage" abstraction here, and use https://github.com/slashdotdash/eventstore as Postgre dependency to connect to Postgree and https://github.com/exponentially/extreme to connect to 'GetEventStore'
The text was updated successfully, but these errors were encountered: