skip to content

Room Database

Android's SQLite layer, with compile-checked DAOs, annotated entities, relations and versioned migrations. Asked because local persistence is where offline behavior and upgrades work or corrupt data.

on this pageshow

explore

questions

page 2 of 2

As the Android lead on a Room app, what schema-change policy would you set for exported schemas, auto versus hand-written migrations, and destructive fallback in release builds?

level: principalimportance: should knowfreq 30%

basics

~10 s

Commit exported schemas and review their diffs, require a tested path from every version still installed, auto-migrate additive changes, hand-write data moves, and keep a blanket fallbackToDestructiveMigration out of release builds.

open as a page

As a team default for Room entities, when should a list such as an event's attendee ids be a converter-backed JSON column rather than its own table?

level: principalimportance: should knowfreq 38%

basics

~20 s

Use a converter-backed JSON column only for small, bounded values read and written whole and never queried by element. Anything queried, referenced or growing belongs in a table, where Room's indexes, foreign keys, relations and exported schema still apply.

open as a page

In Room 3.0, how does @Relation join a child entity to a parent with a composite key, and what did Room 2.x apps do instead?

level: seniorimportance: nice to knowfreq 15%

basics

~20 s

Room 3.0 lists every key column in @Relation's parentColumns and entityColumns arrays, paired by position, and Junction takes arrays too. Room 2.x accepted one column per side, so apps used a single surrogate key or a hand-written JOIN.

open as a page

showing 31–33 of 33