Maryk RocksDB Store
An embedded Maryk data store backed by RocksDB, supporting
JVM, Android, Apple platforms, Linux, Windows and Android Native through the
rocksdb-multiplatform bindings.
Quick start
Section titled “Quick start”Define a model, register its stable ID, and execute Maryk requests:
import maryk.core.models.RootDataModelimport maryk.core.properties.definitions.stringimport maryk.core.query.pairs.withimport maryk.core.query.requests.addimport maryk.datastore.rocksdb.RocksDBDataStore
object Note : RootDataModel<Note>() { val message by string(index = 1u)}
suspend fun main() { RocksDBDataStore.open( relativePath = "notes.db", dataModelsById = mapOf(1u to Note), ).use { execute(Note.add(Note.create { Note.message with "Hello Maryk" })) }}The path is a database directory. Keep model IDs stable across reopens. use
closes the store; otherwise, call close() when finished to release native resources.
The defaults retain history and use a shared 64 MiB cache, 10-bit Bloom filters, automatic index search for bytewise families, and LZ4/Zstandard compression. Existing stores remain readable; opening can run a required storage-format or schema migration. Read the upgrade guidance before upgrading a deployed store.
Guides
Section titled “Guides”| Task | Guide |
|---|---|
| Tune memory, filters, compression, caches or logging; inspect diagnostics | Configuration and tuning |
| Configure history, page revisions or use transactions | History and transactions |
| Encrypt sensitive properties and manage key ownership | Field encryption |
| Upgrade storage or migrate model definitions | Migrations and upgrades |
| Create and restore physical recovery backups | RocksDB backups |
| Transfer data between storage backends | Portable backups |
| Understand the implementation | Architecture and storage layout |
For request examples, see reading and writing. Expose a store through the Remote Store, or add SQL queries when needed.
