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

Add snapshots #19

Open
5 tasks
lukaszb opened this issue Jan 9, 2017 · 0 comments
Open
5 tasks

Add snapshots #19

lukaszb opened this issue Jan 9, 2017 · 0 comments

Comments

@lukaszb
Copy link
Owner

lukaszb commented Jan 9, 2017

Currently Repository.get_aggregate method is not very efficient - it fetches all events that were used to create an aggregate. In order not to do that we want to introduce snapshots.

Change how aggregate is retrieved

Logic behind the get_aggregate should be changed as follow:

  • fetch snapshot with greatest version number for particular aggregate (or all events if there are no snapshot yet)
  • fetch all events with version greater than that from the snapshot

Store snapshots

  • Add Snapshot model
  • Add Storage.create_snapshot method
  • Create snapshot "every now and then" (i.e. every 20 events - this variable should be controlled somehow)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant