felixge / felixge/node-dirty

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

Aperta
#23 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
619
Fork
64
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.