6 releases (breaking)
|Feb 20, 2024
|Jan 30, 2024
|Nov 27, 2023
#64 in Database implementations
361 downloads per month
Used in 8 crates (7 directly)
This module is used in the Linera protocol to map complex data structures onto a
key-value store. The central notion is a
views::View which can
be loaded from storage, modified in memory, then committed (i.e. the changes are
atomically persisted in storage).
The package provides essentially two functionalities:
- An abstraction to access databases.
- Several containers named views for storing data modeled on classical ones.
DESIGN.md for more details.
The supported databases.
The databases supported are of the NoSQL variety and they are key-value stores.
We provide support for the following databases:
MemoryStoreis using the memory
RocksDbStoreis a disk-based key-value store
DynamoDbStoreis the AWS-based DynamoDB service.
ScyllaDbStoreis a cloud based Cassandra compatible database.
The corresponding type in the code is the
A context is the combination of a client and a path (named
base_key which is
A view is a container whose data lies in one of the above-mentioned databases.
When the container is modified the modification lies first in the view before
being committed to the database. In technical terms, a view implements the trait
The specific functionalities of the trait
View are the following:
loadfor loading the view from a specific context.
rollbackfor canceling all modifications that were not committed thus far.
clearfor clearing the view, in other words for reverting it to its default state.
flushfor persisting the changes to storage.
deletefor deleting the changes from the database.
The following views implement the
RegisterViewimplements the storing of a single data.
LogViewimplements a log, which is a list of entries that can be expanded.
QueueViewimplements a queue, which is a list of entries that can be expanded and reduced.
MapViewimplements a map with keys and values.
SetViewimplements a set with keys.
CollectionViewimplements a map whose values are views themselves.
ReentrantCollectionViewimplements a map for which different keys can be accessed independently.
KeyValueStoreand is used internally.
LogView can be seen as an analog of
MapView is an analog of
See the CONTRIBUTING file for how to help out.
This project is available under the terms of the Apache 2.0 license.