Module linera_views::backends::journaling
source · Expand description
Turns a DirectKeyValueStore
into a KeyValueStore
by adding journaling.
Journaling aims to allow writing arbitrarily large batches of data in an atomic way. This is useful for database backends that limit the number of keys and/or the size of the data that can be written atomically (i.e. in the same database transaction).
Journaling requires to set aside a range of keys to hold a possible “header” and an array of unwritten entries called “blocks”.
When a new batch to be written exceeds the capacity of the underlying storage, the “slow path” is taken: the batch of operations is first written into blocks, then the journal header is (atomically) updated to make the batch of updates persistent.
Before any new read or write operation, if a journal is present, it must first be cleared. This is done by processing every block of the journal successively. Every time the data in a block are written, the journal header is updated in the same transaction to mark the block as processed.
Structs§
- A journaling Key Value Store built from an inner
DirectKeyValueStore
.
Enums§
- Data type indicating that the database is not consistent
Traits§
- Low-level, asynchronous direct read/write key-value operations with simplified batch
- Low-level, asynchronous direct write key-value operations with simplified batch