skip to content

As the lead of a production Android app on Room 2.8, when would you move it to Room 3.0, and how would you stage the move?

level: principalimportance: should knowfreq 30%

answer

  1. what only 3.0 offers
  2. stage the work on 2.8 first
  3. setDriver and the wrapper exist in 2.x
  4. package swap in its own release
  5. prove the upgrade on real files

basics

~20 s

Move when you need what only Room 3.0 brings, such as multiplatform targets or its new features, and can afford KSP-only builds and suspend DAOs. Stage it on 2.8 first, with setDriver, the SupportSQLite wrapper, KSP and suspend DAOs, then swap packages.

solid answer

~40 s

It is a cost-benefit call, not a forced upgrade: Room 2.8 keeps working, and 3.0 is a new package, so nothing breaks while you wait. The case for moving is what only 3.0 has: a data layer shared through Kotlin Multiplatform including web targets, `@Fts5`, `WITHOUT ROWID` tables, custom DAO return types. The cost is KSP-only code generation, every DAO function `suspend` or reactive, and no `SupportSQLite`. I'd stage it so each step ships alone on 2.8: move Room to KSP; set a `SQLiteDriver` (since 2.7.0) together with `getSupportWrapper()` (2.8.0) for legacy SQL; convert DAOs to `suspend` or `Flow` and migrations to `SQLiteConnection`. Only then swap `androidx.room` for `androidx.room3`, in its own release with no schema change, proven by an upgrade test that opens a database written by the previous build.

go deeper

for a junior

Know that Room 3.0 is a separate androidx.room3 library, so apps on Room 2.x keep working, and that it needs KSP and suspend DAO functions.

for a middle

Explain which 3.0 requirements Room 2.8 already offers, setDriver, the SupportSQLite wrapper, suspend DAOs and connection-based migrations, and what each changes in calling code.

for a senior

Plan releases that each change one thing, keep the schema frozen across the swap, and prove it with an upgrade test that opens a file written by the previous build.

for a principal

Argue whether to move at all: multiplatform plans and 3.0-only features against KSP, the DAO conversion cost, and the risk to users' only copy of their data.

## The move is optional, so make it deliberately Room 3.0 does not replace Room 2.x in place. It lives in `androidx.room3`, so an app on Room 2.8.5 keeps building and shipping while the team decides. That turns "when are we forced to move" into "what does moving buy, and what does it cost": | | Reasons to move | Reasons to wait | |---|---|---| | Platforms | share the data layer with iOS, desktop and, new in 3.0, JavaScript and Wasm | an Android-only app with no sharing plans | | Features | `@Fts5`, `withoutRowId`, `PrimaryKey.algorithm`, custom DAO return types, composite relation keys | the current features already cover the schema | | Build | Room already runs on KSP | Room still runs on KAPT, or the module cannot apply KSP yet | | Code | DAO functions already `suspend` or `Flow` | many blocking DAO calls and `Cursor` or `SupportSQLite` users | A lead also weighs where the risk lands: the database file on users' phones is the one asset a bad release cannot download again. ## Stage the move on Room 2.8 Room 2.7 and 2.8 already carry most of 3.0's runtime model, so the risky parts can ship one release at a time while the package stays `androidx.room`: 1. **Move Room's processor to KSP.** Since 2.7.0, KSP generates Kotlin by default, which is all 3.0 will generate. 2. **Set a driver and adopt the wrapper together.** `setDriver(AndroidSQLiteDriver())` exists since 2.7.0, but Room 2.x keeps its `SupportSQLite` APIs working only in compatibility mode, while no driver is set. Replace `openHelper.writableDatabase` with `getSupportWrapper()` from `androidx.room:room-sqlite-wrapper` (2.8.0) in the same release. Start with the platform driver so the engine does not change too. 3. **Make DAOs coroutine-first and migrations connection-based**: `suspend` or `Flow` DAO functions, and `Migration.migrate(connection: SQLiteConnection)`, which Room 2.8 already offers. The lessons on Room's coroutines and migrations cover those APIs. 4. **Swap the package in a release of its own**: artifacts to `androidx.room3:*`, imports to `androidx.room3.*`, the Gradle plugin to `androidx.room3`, `@TypeConverter` to `@ColumnTypeConverter`, and the wrapper to `androidx.room3:room3-sqlite-wrapper`. ## Keep the schema still while the library moves - Do **not** combine the swap with a schema change. Keep `@Database(version)` and every entity identical, so the only thing users' files meet is a different library opening them. - Write an **upgrade test**: create a database the way the last 2.x build does, then open it with the 3.0 build and read real rows back. Room's migration test helper, built on the exported schemas, makes the first half repeatable. - Ship the swap through a **staged rollout** and watch for failures at database open, where a schema-integrity `IllegalStateException` or a driver error would surface first. - Decide the **rollback rule** in advance: test that the previous 2.x build still opens a file the 3.0 build has used before counting on a rollback. ## Shape the codebase for it - Keep Room in **one Gradle module**, as the Room 3.0 release notes recommend, so KSP and the Kotlin plugin apply there without touching the rest of the build. - Let **libraries keep their own Room**: WorkManager and others built on Room 2.x ship their copy beside yours. Two Room runtimes in one APK are expected; two runtimes managing one file are not. - Budget the **DAO conversion** honestly. It touches every caller of a blocking DAO function and is usually the largest part of the work, far larger than the package swap. - Choose the **driver** as its own decision, before or after the swap, never during it. ## When the honest answer is "not yet" An Android-only app with Room still on KAPT, hundreds of blocking DAO calls and no multiplatform plans can stay on 2.8 and work through steps 1 to 3 opportunistically. The swap then shrinks to a small, mechanical release that the team can schedule whenever a 3.0-only feature is worth it. The opposite case is just as clear: a team about to share its data layer with an iOS or desktop app, already on KSP and coroutines, gains little by waiting, because every DAO written against Room 2.x is one more file to touch later. Either way, write the decision down with the trigger that would change it, such as a multiplatform project starting or a 3.0-only feature becoming necessary, so it is revisited rather than forgotten.

  • Why set the driver and adopt the wrapper in the same Room 2.x release?
    Room 2.x keeps its SupportSQLite APIs working only while no driver is configured; the Room multiplatform guide calls that compatibility mode. Once `setDriver` is called, code reaching for `openHelper.writableDatabase` has to go through `getSupportWrapper()` instead. Shipping both together keeps every legacy caller working across the switch.
  • Should the package swap to Room 3.0 also switch to BundledSQLiteDriver?
    Better not. The swap should change one thing users' files notice: the library. Changing the SQLite engine in the same release doubles the suspects if opens start failing. Pick the driver on 2.8 or after the swap has settled, weighing the bundled engine's consistency and FTS support against its app-size cost.

  • Room 2.x stops working once Room 3.0 ships, so the move is urgent.
  • The package swap is a good moment to clean up the schema as well.
  • Every Room 3.0 runtime change has to land in one release with the package swap.
  • Libraries that use Room 2.x must be removed before an app can adopt Room 3.0.
  • Moving to Room 3.0 requires raising the version in @Database.

Assumes Room 2.8.5 as the starting point and Room 3.0.3 as the target; setDriver arrived in 2.7.0, room-sqlite-wrapper in 2.8.0, and Room 3.0.0 went stable on 2026-07-01.