Skip to content

Support switching different DBs at regular intervals #283

Open
@yqs112358

Description

@yqs112358

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions