pub enum SyncMode {
BlockAndSync,
BlockNoExplicitSync,
Buffered,
}
Variants§
BlockAndSync
Execute a full sync operation(s) after every single key write. This is very slow (~milliseconds) but minimizes risk of data loss. If the local process fails, data loss is not possible. In the event of a OS level failure or power event, data loss is unlikely but still technically possible e.g. if the hardware further delays writes without the OS knowing. Note: The implementation uses File::sync_all(), so all caveats from there apply.
BlockNoExplicitSync
Blocks on but does not explicitly sync file system operation(s). This is
reasonably fast (~microseconds). In this mode, calling
super::PersistentKeyValueStore::set
or
super::PersistentKeyValueStore::unset
on a key still blocks on the
syscall to append to the write log. This means that local process failures
should not lead to data loss. OS level failures or power events are possible
data loss concerning writes that occured in the seconds prior.
Buffered
Allows for in-memory buffering of writes before writing to disk. There is no limit on the size of frequency of the buffer, so at worst a disk write may not occur until the store instance is dropped.