Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently when using the SQL backend of the ystore the complete document history is stored by default. If the
document_ttl
parameter is set under the specific condition that the time difference between the most recent update and the current update is larger thandocument_ttl
all history is squashed.At the moment this does not reduce the size of the database and in case of changes to the document that occur relatively regularly no squashing ever takes place.
This is a draft for discussion of how an effective trimming and limiting of the history size could be achieved. This would address the request to trim the database (#60) and might also influence the decision to disable the saving of the database (jupyterlab/jupyter-collaboration#244).
To achieve we introduce a new parameter, the
history_length
which limits the age of the oldest entries in the database. All older entries get squashed. Additionally to trim the size of the database deleted entries are vacuumed. This preserves the functionality of the database, e.g. if a client is missing updates we can provide them from the database up to the given age limit. At the same time the total size does not increase infinitely. This is especially important in contexts where the database is counted towards user quotas.