Skip to content

Maryk

Define data once in Kotlin. Validate it, serialize it, store it, query it, inspect it, and sync changes across platforms.

Maryk is a Kotlin Multiplatform data toolkit. The same model definition drives validation, JSON/YAML/ProtoBuf serialization, request building, storage, history, live updates, the CLI, and the desktop App.

Use it when stable data contracts matter more than ad-hoc runtime shape. It gives Kotlin teams a single source of truth for operational data across clients, servers, tools, and tests.

One Model

Define your schema once in Kotlin and reuse it across storage, transport, tools, and tests.

Versioned Storage

Ask for “only changes” or “as of time T”. Stream live updates without extra infrastructure.

Portable Serialization

Streaming YAML/JSON and compact ProtoBuf with consistent encoders/decoders across platforms.

Unified Queries

One request API on every engine: filters, reference graphs (field selection), ordering, limits, aggregations.

Pluggable Stores

Start in‑memory for tests, embed RocksDB for apps, or run FoundationDB for ACID and scale — same API.

Kotlin Multiplatform

Run on JVM, Android, iOS, macOS, Linux, Windows, and JS — share your model and logic.

Desktop App

Browse models, scan records, and edit data in the Maryk App.

  1. Add the dependency
implementation("io.maryk:maryk-core:<maryk-version>")
  1. Define a model
import maryk.core.models.RootDataModel
import maryk.core.properties.definitions.string
object Person : RootDataModel<Person>() {
val firstName by string(index = 1u)
val lastName by string(index = 2u)
}
  1. Create, validate, serialize
val jane = Person.create { firstName with "Jane"; lastName with "Doe" }
Person.validate(jane)
val json = Person.Serializer.writeJson(jane, pretty = true)

Start with Getting Started, then run the complete First Store Tutorial.

When you’re ready to dig in:

Picking storage? See Stores for the overview, or jump straight to In‑Memory, RocksDB, FoundationDB, or Remote.