Ledger

Ledger

2M Downloads

Support switching different DBs at regular intervals

yqs112358 opened this issue ยท 1 comments

commented

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

commented

Some possible alternative solution: #286