Skip to the page

State, data and offline · mid

Local storage: AsyncStorage, MMKV, SQLite and secure storage

Choose storage by data shape and sensitivity: AsyncStorage for small non-sensitive key-values, MMKV for fast synchronous key-values, SQLite (expo-sqlite, op-sqlite) for queryable or large data, and the Keychain/Keystore (react-native-keychain, expo-secure-store) for secrets.

The notes

What you must know

  • AsyncStorage: asynchronous and unencrypted. v3 is instance-based (createAsyncStorage("name"), getMany/setMany) and needs RN 0.76+.
  • MMKV v4: a Nitro (JSI) module, synchronous and memory-mapped, very fast. createMMKV({ id, encryptionKey }); AES-128 by default with an AES-256 option; needs RN 0.76+. Keep the encryption key in the Keychain/Keystore.
  • Synchronous reads are great at startup (theme, flags, no flash of the wrong theme), but big values or hot loops still block the JS thread.
  • SQLite for relational or queryable data, big lists and offline outboxes: expo-sqlite (async and sync APIs, transactions, SQLCipher, a kv-store, works with Drizzle) or op-sqlite (JSI, sync, SQLCipher). WatermelonDB releases have slowed (0.28 in Jul 2025).
  • Secrets: iOS Keychain and Android Keystore-backed storage via react-native-keychain (v11 is New-Architecture-only) or expo-secure-store.
  • Schema migrations: a version table, ordered idempotent migrations inside a transaction, tested from old app versions (users skip releases).

The red pen

Common traps: mistake → fix

  • Mistake: "Tokens in AsyncStorage are fine"

    Fix: it is plain text on disk.

  • Mistake: "MMKV is a database"

    Fix: it is key-value; use SQLite for queries and relations.

  • Mistake: "Encrypt MMKV with a key written in the JS code"

    Fix: the key ships in the bundle.

Easy to hard

Questions interviewers ask, easy to hard

  1. AsyncStorage vs MMKV vs SQLite vs Keychain: how do you choose?
  2. Why is MMKV faster than AsyncStorage?
  3. Is MMKV encryption good enough for tokens?
  4. You added a column to a SQLite table and existing users crash after updating. Why, and how do you ship migrations safely?

Explain it out loud

Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.

Practise by voice

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview