
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.
Kotlin Multiplatform bindings for RocksDB, an embedded key-value store for disk-based storage. Use a shared Kotlin API across JVM, Android, and Kotlin/Native targets.
JVM and Android use the RocksDB Java API. Kotlin/Native uses prebuilt native binaries from build-rocksdb.
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:
The dependency is published in Maven Central. Set rocksdbVersion to the version you want to use:
implementation("io.maryk.rocksdb:rocksdb-multiplatform:$rocksdbVersion")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(key)
println(value?.decodeToString())
}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.
Kotlin Multiplatform bindings for RocksDB, an embedded key-value store for disk-based storage. Use a shared Kotlin API across JVM, Android, and Kotlin/Native targets.
JVM and Android use the RocksDB Java API. Kotlin/Native uses prebuilt native binaries from build-rocksdb.
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:
The dependency is published in Maven Central. Set rocksdbVersion to the version you want to use:
implementation("io.maryk.rocksdb:rocksdb-multiplatform:$rocksdbVersion")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(key)
println(value?.decodeToString())
}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.