Skip to content

aux field in addition to key and val to aid manual diagnostics and rollbacks #23

@nponeccop

Description

@nponeccop

Currently dirty stores 2 fields in its database files: key and value. I propose to add third "aux" field and change db.set() to accept third optional argument. The aux field will be written to the file along with data, but will not be read to memory.

Rationale:

Dirty is a very useful database because it preserves complete transaction history. E.g. if I have a bug and my software deletes all user accounts, I still can recover from this problem by deleting a few last lines from the database log and thus rolling the database back.

To make such rollback easier it would be nice to have a timestamp along with the data, so if I know that a bug was introduced yesterday, I can easily rollback all transactions since yesterday. However, such diagnostic data is not limited by time stamps: one could log user name, user ip or any other information he recognizes as helpful to fight vulnerabilities, fraud and bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions