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

Support switching different DBs at regular intervals #283

Open
2 tasks done
yqs112358 opened this issue Jul 22, 2024 · 1 comment
Open
2 tasks done

Support switching different DBs at regular intervals #283

yqs112358 opened this issue Jul 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@yqs112358
Copy link

yqs112358 commented Jul 22, 2024

Is your feature request related to a problem?

As single ledger.sqlite takes a lot of space on disk, I think it's better to support spliting different DBs at regular intervals, which is not a replacement for purge, but a nice addition function.

On my Mincraft server, the record DB ledger.sqlite rapidly growing to about 1GB in just 7 days. Perhaps I could set autoPurgeDays = xxx in the config file to limit the number of days the logs are stored, thus to limit the size of DB. But that's not good enough: What can I do when I need to look up logs from a month ago?

I think a better solution would be to support switching database files at regular intervals. For example, every 7 days, or every month, ledger would change to use a new DB file. DBs that have been archived can be uploaded elsewhere (e.g. to google drive / onedrive) using tools like automated scripts.

This allows for a better balance between log retention and space consumption.

Describe the solution you'd like.

  • Add a config dbSplitDays to the configuration file with a default value of -1. When this value is non-zero, every dbSplitDays days, the ledger will switch to use a new database file.
  • Add a new config dbFileName to manually set the DB file name format, similar to worldlog-{yy}-{MM}-{dd}.db.

Describe alternatives you've considered.

/

Agreements

  • I have searched for and ensured there isn't already an open issue regarding this.
  • I have ensured the feature I'm requesting isn't already in the latest supported mod version.

Other

No response

@yqs112358 yqs112358 added the enhancement New feature or request label Jul 22, 2024
@yqs112358
Copy link
Author

Some possible alternative solution: #286

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant