Expand description
This library implements a schematized DB on top of RocksDB. It makes sure all data passed in and out are structured according to predefined schemas and prevents access to raw keys and values. This library also enforces a set of specific DB options, like custom comparators and schema-to-column-family mapping.
It requires that different kinds of key-value pairs be stored in separate column
families. To use this library to store a kind of key-value pairs, the user needs to use the
define_schema! macro to define the schema name, the types of key and value, and name of the
column family.
Re-exports§
Modules§
- cache
- All structs related to caching layer of Rockbound.
- schema
- A type-safe interface over
DBcolumn families. - versioned_
db - Provides a database for versioned key-value pairs with one live value and N historical values.
Macros§
- define_
schema - A utility macro to define
Schemaimplementors. You must specify theSchemaimplementor’s name, the key type, the value type, and the column family name.
Structs§
- DB
- This DB is a schematized RocksDB wrapper where all data passed in and out are typed according to
Schemas. - Rocksdb
Config - Port selected RocksDB options for tuning underlying rocksdb instance of our state db. The current default values are taken from Aptos. TODO: tune rocksdb for our workload. see https://github.com/facebook/rocksdb/blob/master/include/rocksdb/options.h for detailed explanations.
- Schema
Batch - (
Schema) atomically. The updates will be applied in the order in which they are added to theSchemaBatch. - Schema
Iterator - DB Iterator parameterized on
Schemathat seeks withSchema::Keyand yieldsSchema::KeyandSchema::Valuepairs.
Enums§
- Codec
Error - An error that occurred during (de)serialization of a
Schema’s keys or values. - Operation
- Represents operation written to the database.
Constants§
- DEFAULT_
COLUMN_ FAMILY_ NAME - The name of the default column family.
Traits§
- Seek
KeyEncoder - This defines a type that can be used to seek a
SchemaIterator, via interfaces likeSchemaIterator::seek. Mind you, not allKeyEncoders shall beSeekKeyEncoders, and vice versa. E.g.:
Functions§
- default_
cf_ descriptor - Returns the default column family descriptor. Includes LZ4 compression.
- gen_
rocksdb_ options - Generate
rocksdb::Optionscorresponding to the givenRocksdbConfig.
Type Aliases§
- Schema
Key - Readability alias for a key in the DB.
- Schema
Value - Readability alias for a value in the DB.