Skip to content

Repository files navigation

AkkaraDB

AkkaraDB is a low-latency embedded key-value database for C++ and Kotlin/JVM applications. It gives you a native storage engine with WAL-backed durability, LSM-based persistence, typed C++ tables, and optional server backends when you need HTTP, TCP, or gRPC access.

Documentation(ドキュメントはこちら)

Current documentation is published at docs.swiftstorm.dev/akkaradb-native. The repository keeps implementation code, benchmarks, and concise build instructions only.

What You Can Use

Choose the entry point that matches your application:

Use case Entry point
Raw embedded KV engine AkkEngine
Typed C++ tables with indexes and query helpers AkkaraDB and PackedTable<&T::id>
Kotlin/JVM integration JNI wrapper with ByteBufferL
Remote access over HTTP/TCP/gRPC akkara/akkserver/ backends

Why AkkaraDB

  • Embedded-first: use it as a local native database without deploying a separate server.
  • Durable by default: WAL, SST storage, manifest tracking, and optional version history are built into the engine.
  • Typed C++ model: high-level tables support schema-like helpers such as secondary indexes, joins, RowId, immutable persisted fields, and foreign-key actions.
  • JVM bridge: Kotlin/JVM code can call the same native engine through JNI.
  • Optional server layer: add HTTP, TCP, or gRPC only when your deployment actually needs it.

Quick Start

Build the native library:

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

Official native builds use LLVM Clang: clang-cl on Windows and clang++ on Linux/macOS. On Windows, run from a Visual Studio developer environment so the MSVC linker and Windows SDK are initialized:

cmd /c "call ""C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvars64.bat"" >nul && cmake --preset windows-clang-cl-release && cmake --build --preset windows-clang-cl-release"

Experimental query-rewrite build on Windows:

cmd /c "call ""C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvars64.bat"" >nul && cmake --preset windows-clang-cl-release && cmake --build --preset windows-clang-cl-query-rewrite-build"

This target copies the source tree under builds/akkara-query-rewrite/, runs the Akkara query Clang plugin against copied .cpp translation units, replaces only the copied files with rewritten versions, and then builds the copied tree. The original source tree is not modified.

Build the JNI bridge when you need the JVM wrapper:

cmake -B build-jni -DCMAKE_BUILD_TYPE=Release -DAKKARADB_BUILD_JNI=ON
cmake --build build-jni --config Release

Minimal typed C++ example:

struct User {
    uint64_t id;
    std::string email;
    std::string name;
};

AKKARADB_QUERYABLE(User, id, email, name)

auto db = akkaradb::AkkaraDB::open("data", akkaradb::StartupMode::FAST);
auto users = db->table<&User::id>("users");

users.index<&User::email>();
users.put({1, "alice@example.test", "Alice"});

auto alice = users.get(1ULL);

Minimal low-level engine example:

#include <string_view>

std::span<const uint8_t> bytes(std::string_view s) {
    return {
        reinterpret_cast<const uint8_t*>(s.data()),
        s.size()
    };
}

akkaradb::engine::AkkEngineOptions opts;
opts.paths.dataDir = "data";

auto engine = akkaradb::engine::AkkEngine::open(std::move(opts));
engine->put(bytes("user:1"), bytes("Alice"));

Repository Map

akkara/              Native engine, typed API, JNI, and server backends
benchmarks/          Smoke tests and throughput benchmarks

License

The native core of AkkaraDB is licensed under the Mozilla Public License 2.0. See LICENSE.

akkara/akkserver/ is licensed separately under the GNU Affero General Public License v3.0. See LICENSE_SERVER.

About

The all-purpose KV store: blazing fast and reliably durable, scaling from tiny embedded cache to large-scale distributed database

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages