Unlock speed where every write counts.

TidesDB is a light-weight C++ library that provides an embeddable, persistent key-value store for fast flash and ram storage. TidesDB has a robust feature-set, and was designed from the ground up to be a high-performance, low-latency storage engine. It is optimized for write and read-heavy workloads.

User Guide

Basic Usage

  1. Initialize the LSMT:
    #include "libtidesdb.h"
            
    int main() {
        auto lsmt = TidesDB::LSMT::New("data_directory", std::filesystem::perms::owner_all, 1024 * 1024, 60, 4);
        // Use the LSMT instance
        lsmt->Put({1, 2, 3}, {4, 5, 6});
        auto value = lsmt->Get({1, 2, 3});
        lsmt->Close();
        return 0;
    }

  2. Insert a key-value pair:

    TidesDB takes keys and values as vectors of bytes, there is no limit to key and or value size.

    Writing to the same key updates the value.

    lsmt->Put({1, 2, 3}, {4, 5, 6});

  3. Retrieve a value by key:
    auto value = lsmt->Get({1, 2, 3});

  4. Delete a key-value pair:
    lsmt->Delete({1, 2, 3});

  5. Close the LSMT:

    Flushes memtable to disk on close.

    Commits any active transactions.

    lsmt->Close();

API Guide

Classes and Methods

TidesDB::LSMT


TidesDB::Pager

TidesDB::AVLTree

TidesDB::Transaction

TidesDB::Wal

Enumerations

TidesDB::OperationType

Utility Functions

Example

#include "libtidesdb.h"
        
int main() {
    auto lsmt = TidesDB::LSMT::New("data_directory", std::filesystem::perms::owner_all, 1024 * 1024, 60, 4);
    lsmt->Put({1, 2, 3}, {4, 5, 6});
    auto value = lsmt->Get({1, 2, 3});
    lsmt->Close();
    return 0;
}

This guide provides a basic overview of how to use the TidesDB library. For more detailed information, refer to the source code and comments within the library.