class

Storage::KeyValueStore

Inherits Reference / Object

Constants

HARD_DURABILITY = RocksDB::WriteOptions.new

Hard durability: data is written on disk always. This is the default and this is paranoic. No data will be lost, ever.

MINIMAL_DURABILITY = RocksDB::WriteOptions.new

Minimal durability: data it stored in memory only and flushed to disk at some later point. A process crash might cause data loss. A graceful server close (calling .close()) won't lose data. Note: The data might be lost, but it won't be corrupted. This is the fastest option.

PREFIX_DATABASES = 1_u8
PREFIX_INDICES = 3_u8
PREFIX_SYSTEM_INFO = 0_u8
PREFIX_TABLES = 2_u8
SOFT_DURABILITY = RocksDB::WriteOptions.new

Soft durability: data is sent to the operating system memory and will be synced to disk later. Only a kernel panic or hardware failure might cause data loss. Crashing the process won't lose any data.

Constructors

new(database_path : String)
Source

Class methods

decompose_index_entry_key(index_entry_key : Bytes)
Source
key_for_database(id : UUID)
Source
key_for_system_info
Source
key_for_table(id : UUID)
Source
key_for_table_index(table_id : UUID, index_id : UUID)
Source
key_for_table_index_end(table_id : UUID)
Source
key_for_table_index_entry(index_value : Bytes, counter : Int32, primary_key : Bytes)
Source
key_for_table_index_entry_end(index_value : Bytes)
Source
key_for_table_index_entry_start(index_value : Bytes)
Source
key_for_table_index_start(table_id : UUID)
Source

Instance methods

build_index(table_id : UUID, index_id : UUID, &)
Source
close
Source
create_batch
Source
database_path
Source
delete_index_entry(table_id : UUID, index_id : UUID, index_value : Bytes, counter : Int32, primary_key : Bytes)
Source
delete_row(table_id : UUID, primary_key : Bytes, durability : ReQL::Durability = ReQL::Durability::Soft) : Bytes | Nil
Source
drop_index_data(index_id : UUID)
Source
each_db
Source
each_index(table_id : UUID, &)
Source
each_index_entry(table_id : UUID, index_id : UUID, index_value_start : Bytes, index_value_end : Bytes, snapshot : RocksDB::BaseSnapshot | Nil = nil, &)
Source
each_row(table_id : UUID, &)
Source
each_table
Source
estimated_table_count(table_id : UUID)
Source
get_db(id : UUID)
Source
get_row(table_id : UUID, primary_key : Bytes, snapshot : RocksDB::BaseSnapshot | Nil = nil, &)
Source
get_table(id : UUID)
Source
save_db(db : DatabaseInfo)
Source
save_index(index : IndexInfo)
Source
save_table(table : TableInfo)
Source
set_index_entry(table_id : UUID, index_id : UUID, index_value : Bytes, counter : Int32, primary_key : Bytes)
Source
set_row(table_id : UUID, primary_key : Bytes, data : Bytes, durability : ReQL::Durability = ReQL::Durability::Soft)
Source
snapshot
Source
system_info
Source
system_info=(system_info : Storage::KeyValueStore::SystemInfo)
Source
table_data_family(table_id : UUID)
Source
table_index_family(index_id : UUID)
Source
write_batch(batch, durability : ReQL::Durability = ReQL::Durability::Soft)
Source

Nested types