Skip to content

Maryk

Strongly‑typed Kotlin models with built‑in versioning, compact serialization, and a single query API across stores.

Maryk is a Kotlin Multiplatform toolkit for data. You describe your data once — with types and validation — and use that same model across clients and servers.

  • Strong types, one schema for JVM, Android/Android Native, iOS, macOS, watchOS, tvOS, Linux, Windows, and JS.
  • Version‑aware storage with historic reads, change streams, and efficient sync.
  • Portable serialization (YAML/JSON streaming, compact ProtoBuf).
  • Pluggable stores with the same API (In‑Memory, RocksDB, FoundationDB, Remote).

One Model

Define your schema once in Kotlin and reuse it everywhere — fewer mismatches, better autocomplete.

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:<version>")
  1. Define a model
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.toJson(pretty = true)

Start with the overview in What is Maryk? and the short case for Why Maryk?.

When you’re ready to dig in:

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