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.

flowchart TB
accTitle: One model connects the data layers
accDescr: A Kotlin model defines validation, serialization, requests and tooling. Stores execute the typed requests.
Model["Kotlin data model"] --> Values["Create and validate values"]
Model --> Serialization["JSON, YAML and ProtoBuf"]
Model --> Requests["Typed requests"]
Model --> Tools["App, CLI and generators"]
Requests --> Stores["Memory, IndexedDB, RocksDB, FoundationDB or Remote"]
LayerRole
Data modelsdefine properties, indexes, validations, keys, and references.
Valuesare typed records created and validated through those models.
Requestsdescribe add/change/delete/get/scan/history/update operations, atomic change sets and serializable transaction journals.
SQLprovides optional bounded queries, joins, reporting and mutations over those same models and requests.
Storesexecute requests through one API: Memory, IndexedDB, RocksDB, FoundationDB, Remote.
Serializationwrites the same values and requests as YAML, JSON, or ProtoBuf.
Toolslet 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 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.