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

FEAT: database persistence to disk #4

Closed
edwinkys opened this issue Dec 14, 2023 · 1 comment · Fixed by #8
Closed

FEAT: database persistence to disk #4

edwinkys opened this issue Dec 14, 2023 · 1 comment · Fixed by #8
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@edwinkys
Copy link
Member

Use case

Currently, the database data, key-value pairs and index, is stored only in memory. This means that every time the database is restarted, we need to re-add the key-value and rebuild the index.

This feature should allow the database data to be persisted to disk so that when there is crash or shutdown, the data and index of previous session can still be used.

Proposed solution

The database should store a snapshot of the key-value pairs periodically. Every time, the database is started, the database will lookup the most recent snapshot and prepopulate the key-value store and rebuild the index based on the existing key-value pairs.

Additional Context

@edwinkys edwinkys added the enhancement New feature or request label Dec 14, 2023
@edwinkys edwinkys self-assigned this Dec 15, 2023
@edwinkys
Copy link
Member Author

Revision on proposed solution

In addition to creating periodical snapshots, we should also implement append-only logging that will record write/delete operations.

This allows us to increase the durability of the persistence process, increase intervals between snapshots, and decrease the size of the log file.

@edwinkys edwinkys added the help wanted Extra attention is needed label Dec 17, 2023
@edwinkys edwinkys linked a pull request Dec 19, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant