Skip to content

What is Maryk?

Maryk is a Kotlin Multiplatform data toolkit built around one idea: the data model should be the contract.

You define the model once in Kotlin. Maryk uses it to validate values, serialize values, build typed requests, execute those requests against stores, retain history, stream updates, and drive tooling.

  • Data models define properties, indexes, validations, keys, and references.
  • Values are typed records created and validated through those models.
  • Requests describe add/change/delete/get/scan/history/update operations.
  • Stores execute requests through one API: Memory, RocksDB, FoundationDB, Remote.
  • Serialization writes the same values and requests as YAML, JSON, or ProtoBuf.
  • Tools let you inspect and edit records through the CLI and App.
object Person : RootDataModel<Person>() {
val firstName by string(index = 1u)
val lastName by string(index = 2u)
val dateOfBirth by date(index = 3u)
}
val john = Person.create { firstName with "John"; lastName with "Smith" }
Person.validate(john) // throws if invalid

Maryk uses stable property indexes. This makes serialization compact and lets readers skip unknown fields. That is the basis for safe evolution, cross-platform compatibility, and history-aware storage.

Maryk also treats queries as typed request objects. Those requests can run locally, be serialized, be sent to a remote store, or be watched as update streams.

  • Multi-client apps that need one shared data contract.
  • Local-first apps that need embedded persistence and sync.
  • Kotlin backends that want typed operational storage and compact transport.
  • Tools that need to read, validate, export, import, or edit structured records.
  • Systems that benefit from historic reads, update streams, or incremental sync.