LmdbJava Documentation

repository·master·Indexed 21 days ago

https://github.com/lmdbjava/lmdbjava

A high-performance, low-latency Java wrapper for the LMDB (Lightning Memory-Mapped Database) providing ACID transactions and a zero-copy design. It supports Java ByteBuffer, Agrona DirectBuffer, and Netty ByteBuf, with embedded native libraries for Linux, OS X, and Windows.

Tokens
554
Snippets
2
Records
4
Agent score
25%

What's inside LmdbJava

  1. Overview of LmdbJava

    master

    LmdbJava is a high-performance Java wrapper for LMDB (Lightning Memory-Mapped Database). It provides a modern, idiomatic Java API while leveraging the speed and ACID semantics of the original C implementation.

    Key features include:

    • Zero-copy design: No serialization or memory copy overhead.
    • Buffer agnostic: Supports Java ByteBuffer, Agrona DirectBuffer, Netty ByteBuf, or custom buffers.
    • No installation required: The JAR embeds the latest LMDB libraries for Linux, OS X, and Windows.
    • High performance: Low latency and allocation-free design, suitable for heavy production workloads.
    • Concurrency: Supports multi-threading (MVCC-isolated transactions) and multi-process access on the same host.
  2. Add LmdbJava to your project via Maven

    master

    LmdbJava is available on Maven Central. You can include it in your project using the standard Maven dependency mechanism. The JAR includes the necessary native libraries for Linux, OS X, and Windows automatically.

    <!-- Example Maven dependency (refer to Maven Central for exact version) -->
    <dependency>
        <groupId>org.lmdbjava</groupId>
        <artifactId>lmdbjava</artifactId>
        <version>VERSION</version>
    </dependency>
  3. Configure a custom LMDB native library

    master

    By default, LmdbJava uses the native libraries provided by the org.lmdbjava:native dependency. If you need to use a different LMDB library, you can specify the file path to your own library using the lmdbjava.native.lib system property.

    java -Dlmdbjava.native.lib=/path/to/your/liblmdb.so -jar your-app.jar