Google Introduces Room 3.0: A Kotlin-First, Async, Multiplatform Persistence Library
Summary
Google has introduced Room 3.0, a significant update to Android's persistence library, which is now Kotlin-first, generating only Kotlin code and exclusively using KSP (Kotlin Symbol Processing) for processing. This release removes support for Java Annotation Processing and KAPT, requiring the Kotlin compiler even for Java-only codebases. Architecturally, Room 3.0 eliminates Android's native SQLite API (SupportSQLite) in favor of KMP-compatible `androidx.sqlite` driver APIs and adopts a coroutine-first model, making all DAO functions `suspend` or return Kotlin Flow. Furthermore, it extends platform support to JavaScript and WebAssembly (WasmJS), introducing a new `sqlite-web` driver for web storage in the Origin private file system (OPFS). A compatibility layer, `room-sqlite-wrapper`, is provided to aid migration, while Room 2 enters maintenance mode.
Key takeaway
Google's Room 3.0 modernizes Android persistence as a Kotlin-first, coroutine-driven, multiplatform library, exclusively using KSP and `androidx.sqlite` drivers. This update removes Java AP/KAPT and Android's native SQLite API, making all DAO functions `suspend` and extending support to JavaScript and WebAssembly. It simplifies codebase development for modern Android and multiplatform applications, but requires migration to KSP and a coroutine-first model, with Room 2 now in maintenance.
Topics
- Room 3.0
- Kotlin Multiplatform
- KSP
- Kotlin Coroutines
- Android Persistence
Best for: Machine Learning Engineer, Product Manager, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by InfoQ.