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

Event log compaction #25

Open
bryannaegele opened this issue May 3, 2019 · 2 comments
Open

Event log compaction #25

bryannaegele opened this issue May 3, 2019 · 2 comments

Comments

@bryannaegele
Copy link

This issue is to discuss event log growth currently being unbounded. In order prevent OOM errors, the event log must be rolled up with some regularity.

etcd's approach to this problem appears to be compacting based on a combination of max allowed entries and elapsed time - https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/maintenance.md#raft-log-retention. Each of these approaches seem desirable to cover most situations.

Initial thoughts on possible options would be:

  1. snapshot at max_sequence_id and delete from there back
  2. snapshot at x events back and delete from there back
  3. delete back from the sequence id on the last snapshot

I propose we implement each of these approaches with sane defaults. Users can adjust these configuration options and pick a strategy that best suits their needs.

@NeilMenne
Copy link
Member

To document a few things we discussed out of band, I do think that compaction is essential to the long term success of an event sourced application.

Your proposal for snapshotting periodically seems reasonable and fits into the GenServer approach that we have.

Deleting events should definitely be disabled by default, but having an operation that allows for it both in the store and more importantly on the aggregate is a good idea as well.

@NeilMenne
Copy link
Member

Developing a solution for dealing with max_sequence_id or even warning when that's getting close is probably a separate concern since we're actually talking about the max for the integer type in postgres.

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

2 participants