Getting Started
Maryk runs on Kotlin Multiplatform and ships as modular artifacts. This guide shows the minimal setup and a first round‑trip from model → object → validation → serialization → storage.
Dependency
Section titled “Dependency”Add the core dependency to your target(s):
dependencies { implementation("io.maryk:maryk-core:<version>")}For stores, add one engine:
// In-memory (tests/dev)implementation("io.maryk:store-memory:<version>")
// Embedded RocksDB (apps/servers)implementation("io.maryk:store-rocksdb:<version>")
// FoundationDB (JVM server)implementation("io.maryk:store-foundationdb:<version>")Define a model
Section titled “Define a model”object Person : RootDataModel<Person>() { val firstName by string(index = 1u) val lastName by string(index = 2u) val dateOfBirth by date(index = 3u)}Create and validate:
val john = Person.create { firstName with "John" lastName with "Smith" dateOfBirth with LocalDate(2017, 12, 5)}
Person.validate(john)Serialize
Section titled “Serialize”val json = Person.writeJson(john)val fromJson = Person.readJson(json)Also see YAML/ProtoBuf in Serialization.
Pick a datastore
Section titled “Pick a datastore”Use in‑memory for tests:
InMemoryDataStore.open( keepAllVersions = true, dataModelsById = mapOf(1u to Person)).use { store -> store.execute(Person.add(john))}Then advance to Stores for RocksDB or FoundationDB and migration tips.
Use the CLI to explore models and records, run scans, and edit values without writing code.
Use the Maryk App for a desktop UI to browse models and edit records.
./gradlew :app:runNext steps
Section titled “Next steps”- Learn how models and properties work in Data design.
- Explore queries, filters, and aggregations in Querying.
- Check out how to persist data in Stores.
- Browse and edit data interactively with the CLI.