Go library for storing application state.
In all kinds of applications that store their state in RAM and would like to save it to disk - cyclically, on demand or during shutdown. In other words, they would like to save a snapshot of their in-memory data structures to disk and restore them during startup.
go get -u github.com/elgopher/deebee
See example/json/main.go. More examples in example directory. You can also check deebee-loans - an example web application using in-memory state and DeeBee for persistence.
- either the state is saved completely or not at all
- tolerance for killing the app while writing, restarting the machine or loss of power
- tolerance for disk problems, buggy drivers or firmware
- tolerance for accidental file altering
- all previous states are available
- ability to read latest integral file (fail-over to previous version if latest is corrupted)
- API for deleting historical data - on demand or cyclically
- ability to copy latest version of state to another file-system (such as NFS)
- API for reading from multiple replicated stores
- small API with just a few functions and small amount of production code
- no external dependencies
- extensibility - new data formats can be easily added in a form of custom Codecs
- data is stored on disk as it was saved by the app, so it can be easily read using editor of-choice
- data can be updated by hand (when integrity check is disabled or when user also updated the checksum)
- read/write files using standard
os
package - use cloud storage services, such as AWS S3
MVP almost ready. The API is still changing though.