With version v0.3.0, TerrabaseDB can be used as a persistent key/value store.
How persistence works
As per the current design, TDB on startup will check if the
data.bin file exists in the working directory. If it does, then the existing key/value pairs are restored, otherwise an empty
HashMap<K, V> is loaded into memory. When the database shuts down, the keys are written to disk.
However, the current persistence strategy is not very efficient since it rewrites the entire in-memory table back onto disk, regardless of changes, that is, even if no changes are made, TDB still rewrites the same data to disk. This will change in the future with a better disk storage format.