
Implements a cross-platform solution for RocksDB, enabling high-performance embedded key-value storage across various platforms, with full API support on JVM, Android, Linux, iOS and macOS.
This project provides Kotlin Multiplatform bindings for RocksDB, a high-performance embedded key-value store for storage of data on disk. It uses the official native RocksDB implementation and exposes it through a Kotlin API, with prebuilt native binaries for the supported targets. Those native binaries are built separately in build-rocksdb.
The aim of this project is to make RocksDB usable from shared Kotlin code across JVM, Android, and native Linux/macOS/iOS/tvOS/watchOS/Windows targets. On JVM and Android it bridges the RocksDB Java API. On Kotlin/Native targets it calls the native RocksDB library through Kotlin/Native interop.
This project is useful for developers who want to build multiplatform applications that require high-performance disk-based storage. Because the storage engine is still upstream RocksDB, performance should be close to RocksDB itself, apart from the expected JNI or native interop overhead depending on the target and usage pattern.
The project supports the full RocksDB Java interfaces on the JVM and Android platforms. The common Kotlin API includes most common operations, but if you need additional features, you can request them by creating an issue or submitting a merge request.
Kotlin Native:
You can refer to the API reference or the official RocksDB website for more information.
The dependency is published in Maven Central, so you can easily add it to your project:
implementation("io.maryk.rocksdb:rocksdb-multiplatform:10.10.1")Here's an example of how to open a RocksDB database, write a key-value pair and retrieve the value by key:
openRocksDB("path_to_store_on_disk").use { db ->
val key = "test".encodeToByteArray()
db.put(key, "value".encodeToByteArray())
val value = db.get("test".encodeToByteArray())
println(value?.decodeToString())
}Check out the tests for more examples on how to use this library.
We welcome contributions to the project! If you find a bug or want to suggest a new feature, please submit an issue or submit a pull request.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.
This project provides Kotlin Multiplatform bindings for RocksDB, a high-performance embedded key-value store for storage of data on disk. It uses the official native RocksDB implementation and exposes it through a Kotlin API, with prebuilt native binaries for the supported targets. Those native binaries are built separately in build-rocksdb.
The aim of this project is to make RocksDB usable from shared Kotlin code across JVM, Android, and native Linux/macOS/iOS/tvOS/watchOS/Windows targets. On JVM and Android it bridges the RocksDB Java API. On Kotlin/Native targets it calls the native RocksDB library through Kotlin/Native interop.
This project is useful for developers who want to build multiplatform applications that require high-performance disk-based storage. Because the storage engine is still upstream RocksDB, performance should be close to RocksDB itself, apart from the expected JNI or native interop overhead depending on the target and usage pattern.
The project supports the full RocksDB Java interfaces on the JVM and Android platforms. The common Kotlin API includes most common operations, but if you need additional features, you can request them by creating an issue or submitting a merge request.
Kotlin Native:
You can refer to the API reference or the official RocksDB website for more information.
The dependency is published in Maven Central, so you can easily add it to your project:
implementation("io.maryk.rocksdb:rocksdb-multiplatform:10.10.1")Here's an example of how to open a RocksDB database, write a key-value pair and retrieve the value by key:
openRocksDB("path_to_store_on_disk").use { db ->
val key = "test".encodeToByteArray()
db.put(key, "value".encodeToByteArray())
val value = db.get("test".encodeToByteArray())
println(value?.decodeToString())
}Check out the tests for more examples on how to use this library.
We welcome contributions to the project! If you find a bug or want to suggest a new feature, please submit an issue or submit a pull request.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for details.