Persistence is done using LevelDB. All software that is LevelDB compatible can process the quasardb persistence layer.
Entries are stored “as is”, unmodified. The quasardb ensures that the most frequently access entries stay in memory so it can rapidly serve a large amount of simultaneous requests (see Concurrency).
All entries are persisted to disk as they are added and updated. When a put or add request has been processed, it is guaranteed that the persistence layer has fully acknowledged the modification.
The persistence layer may compress data for efficiency purposes. This is transparent to the client and never done to the detriment of performance.
By default, the persistence layer uses a write cache to increase performance, but this can be disabled (see quasardb daemon). When the write cache is disabled, the server will not return from a put or update request until the entry is acknowledged by the file system.
Entries are evicted according to the configured thresholds (see quasardb daemon).
Since entries are persisted to disk as they are added, an eviction cannot result in the entry being inaccessible.
Eviction is an atomic operation that respects the ACID properties of requests (see Concurrency).
An evicted entry stays on disk until requested at which point it is “paged in”.
Entries are elected for eviction using a combination of statistics and probability (fast monte carlo algorithm).
It is possible to disable persistence altogether (see quasardb daemon). This is called the transient mode.
In this mode:
- Performance may increase
- Memory usage may be reduced
- Disk usage will be significantly lowered
But:
- Evicted entries will be lost
- Node failure may imply irrecoverable data loss
- Node and cluster statistics will not be recorded
Transient mode is a clever way to transform a quasardb cluster into a powerful cache.
As of quasardb 1.1.5, statistics such as CPU, RAM, and disk usage and network traffic are permanently recorded in the database. These can be displayed using the quasardb web server. The statistics accrue at a rate of approximately 50 MiB per year. Statistics cannot be disabled unless the cluster is transient.