> Markdown version of [/videos/694-build-delightful-mobile-experiences-with-kotlin-realm-and-atlas-device-sync?t=583](https://www.wearedevelopers.com/videos/694-build-delightful-mobile-experiences-with-kotlin-realm-and-atlas-device-sync?t=583). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # Build Delightful Mobile Experiences with Kotlin, Realm, and Atlas Device Sync Quit writing custom sync layers and complex conflict resolution logic. Combine Kotlin, Realm, and Atlas Device Sync to effortlessly automate your app's offline-first architecture. - **Speakers:** Timothy Marland - **Event:** World Congress 2023 - **Published:** September 27, 2023 - **Duration:** 25:08 - **URL:** https://www.wearedevelopers.com/videos/694-build-delightful-mobile-experiences-with-kotlin-realm-and-atlas-device-sync ## Summary The video explores the familiar challenges of building resilient, offline-first mobile applications that seamlessly synchronize with backend databases. Rather than spending extensive time creating custom sync layers, REST APIs, and complex conflict resolution logic, developers can employ Realm and Atlas Device Sync. Realm acts as a highly optimized, local mobile database that stores live objects directly, eliminating the need for Object-Relational Mapping (ORM) and ensuring user interfaces update instantly. Atlas Device Sync securely bridges the gap between the local data and the cloud, utilizing WebSockets and TLS 1.4 to provide out-of-the-box, real-time synchronization. This architecture fundamentally reduces undifferentiated heavy lifting by handling dropped network connections and asynchronous edits through Operational Transformation, ensuring accurate conflict resolution without manual intervention. Furthermore, Atlas Device Sync provides highly flexible data replication, transferring only the necessary differentials via GZIP, alongside robust, document-level and field-level permission controls that inherently distrust the client context to prevent unauthorized data manipulation. For specific use cases with one-way data flows like IoT sensors or system logs, a specialized Data Ingest mode bypasses computationally expensive conflict resolution entirely for maximum performance. Coupled with the newly released server-side Kotlin driver native to MongoDB, developers can read and write data flawlessly. Additionally, immediate access to auto-generated GraphQL endpoints allows unified reporting and broad platform integration without writing extra backend code. Ultimately, offloading this intricate offline architecture to Realm empowers engineering teams to deliver highly reactive user experiences while bypassing the risks of siloed databases and missed launch deadlines. **Keywords:** offline-first mobile architecture, realm local database, atlas device sync, websocket synchronization, operational transformation, object-relational mapping elimination, graphql endpoint generation, iot sensor data logging, field-level security permissions, differential data replication, server-side kotlin driver, mongodb app services, one-way data ingest, mobile database optimization, network connectivity resilience ## Chapters 1. **Challenges of traditional mobile data synchronization** (01:35) — Building manual sync layers using object-relational mapping, APIs, and message queues introduces significant error handling risks. 1. **Introduction to Realm and Atlas Device Sync** (05:57) — Realm replaces traditional database setups by storing live objects locally and efficiently synchronizing state over WebSockets. 1. **Architectural overview and offline data flow** (09:43) — Local applications push transactions to the cloud where operational transformation seamlessly resolves underlying data conflicts. 1. **Granular data querying and permission rules** (12:21) — Role-based access controls dictate specific document and field-level permissions to enforce strict application constraints. 1. **One-way data ingestion for IoT devices** (14:51) — Streaming one-way sensor data directly to Atlas avoids the computational overhead of bidirectional conflict resolution. 1. **Creating an Atlas App Services backend** (16:40) — Scaffolding a backend application with a real-time Kotlin template streamlines project setup using the Atlas CLI. 1. **Testing real-time sync and offline behavior** (20:23) — Toggling device network connectivity demonstrates how localized data updates automatically propagate across clients once a connection restores. 1. **Configuring collection rules and GraphQL endpoints** (23:25) — Cloud-based environments provide instantaneous enforcement of customized write permissions and direct access to underlying datasets via GraphQL. ## Related Moments - [Synchronizing offline data with MongoDB Realm and Atlas](https://www.wearedevelopers.com/videos/183-from-zero-to-mobile-developer-in-45-minutes-with-swiftui) (from "From Zero to Mobile Developer in 45 Minutes With SwiftUI") - [Real-time offline synchronization demo with AWS Amplify](https://www.wearedevelopers.com/videos/554-offline-first-automatic-data-synchronisations-for-your-web-and-mobile-applications) (from "Offline first & automatic data synchronisations for your web and mobile applications") - [Architecture of the SwiftUI and Realm chat application](https://www.wearedevelopers.com/videos/183-from-zero-to-mobile-developer-in-45-minutes-with-swiftui) (from "From Zero to Mobile Developer in 45 Minutes With SwiftUI") - [Modern application stacks and real-time data requirements](https://www.wearedevelopers.com/videos/806-leveraging-real-time-data-in-fsis) (from "Leveraging Real time data in FSIs") - [Centralizing mobile business logic with Kotlin Multiplatform](https://www.wearedevelopers.com/videos/100341-vertical-slice-architecture-micro-frontends-across-mobile-backend-ml) (from "Vertical Slice Architecture: Micro Frontends Across Mobile, Backend & ML") - [Simplifying offline data persistence using AWS Amplify DataStore](https://www.wearedevelopers.com/videos/554-offline-first-automatic-data-synchronisations-for-your-web-and-mobile-applications) (from "Offline first & automatic data synchronisations for your web and mobile applications") ## Related Articles - [Dev Digest 139 - Soft and hard queries](https://www.wearedevelopers.com/magazine/487-dev-digest-139-soft-and-hard-queries) - [Dev Digest 132 - Binging WADFlix?](https://www.wearedevelopers.com/magazine/473-dev-digest-132-binging-wadflix) - [Basic And Advanced Networking in Dart and Flutter](https://www.wearedevelopers.com/magazine/112-basic-and-advanced-networking-in-dart-and-flutter) - [Dev Digest 120 - Apple and peers](https://www.wearedevelopers.com/magazine/455-dev-digest-120-apple-and-peers) ## Related Jobs - [Founding Mobile Engineer (iOS)](https://www.wearedevelopers.com/jobs/ext/1648532-founding-mobile-engineer-ios) at **Almedia** - [Senior Software Engineer, Android (Earn Experience)](https://www.wearedevelopers.com/jobs/ext/1937627-senior-software-engineer-android-earn-experience) at **Bitpanda** - [Senior React Native Developer](https://www.wearedevelopers.com/jobs/ext/1518176-senior-react-native-developer) at **Almedia** - [Senior Backend Engineer (Java)](https://www.wearedevelopers.com/jobs/ext/19369-senior-backend-engineer-java) at **Bonial International GmbH** - [Senior Software Engineer, Client Apps Platform](https://www.wearedevelopers.com/jobs/ext/1773893-senior-software-engineer-client-apps-platform) at **GitHub** - [iOS Engineer, Swift/SwiftUI/Combine (B2C Broker)](https://www.wearedevelopers.com/jobs/ext/1611832-ios-engineer-swift-swiftui-combine-b2c-broker) at **Bitpanda**