KMP Tutorial #16: Building the Shared Data Layer — Offline-First with Ktor and SQLDelight

In the previous tutorial, we set up the Notes app architecture with a local database and shared ViewModels. Everything works offline. But real apps need to sync with a server. In this tutorial, we build the shared data layer — adding a Ktor API client, Data Transfer Objects (DTOs), an offline-first sync pattern, and a database migration. All of this code lives in commonMain and runs on both Android and iOS. ...

April 6, 2026 · 8 min

KMP Tutorial #7: SQLDelight — Database in Kotlin Multiplatform

In the Ktor tutorial, we loaded data from the internet. But what happens when the user has no internet? The app shows nothing. You need a local database — and in KMP, that means SQLDelight. SQLDelight is the opposite of Room. Room generates SQL from Kotlin. SQLDelight generates Kotlin from SQL. You write real SQL queries, and SQLDelight generates type-safe Kotlin code. It works on Android, iOS, Desktop, and Web — all from the same .sq files. ...

April 3, 2026 · 11 min