choose-storage

Decide storage layer for an Expo app: expo-sqlite + drizzle vs MMKV vs SecureStore vs AsyncStorage vs Zustand persist. Use when the user says 'storage', 'database', 'where to save data', 'AsyncStorage vs MMKV', 'expo-sqlite'.

khadinakbarlabs/expo-mobile-app-builder2 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: choose-storage
description: Decide storage layer for an Expo app: expo-sqlite + drizzle vs MMKV vs SecureStore vs AsyncStorage vs Zustand persist. Use when the user says 'storage', 'database', 'where to save data', 'AsyncStorage vs MMKV', 'expo-sqlite'.
license: MIT
---

# Choose Storage

Pick the right Expo storage primitive.

## Decision tree
- **Tokens, passwords, API keys** → expo-secure-store (Keychain on iOS)
- **Tiny preferences (<10 keys)** → AsyncStorage or Zustand persist
- **Fast key/value (>10 keys, frequent reads)** → MMKV (`react-native-mmkv`)
- **Structured data, complex queries** → expo-sqlite + drizzle-orm
- **Large blobs / images** → expo-file-system
- **Cross-device sync** → CloudKit private DB (requires native bridge or expo-cloud-storage if available)

## expo-secure-store
```ts
import * as SecureStore from 'expo-secure-store';
await SecureStore.setItemAsync('authToken', token);
const token = await SecureStore.getItemAsync('authToken');
```

## MMKV
```bash
npm install react-native-mmkv
```
```ts
import { MMKV } from 'react-native-mmkv';
export const storage = new MMKV();
storage.set('user.id', '123');
const id = storage.getString('user.id');
```
~30x faster than AsyncStorage. Sync API.

## expo-sqlite + drizzle
```bash
npx expo install expo-sqlite
npm install drizzle-orm
npm install -D drizzle-kit
```
```ts
import { drizzle } from 'drizzle-orm/expo-sqlite';
import * as SQLite from 'expo-sqlite';

const sqlite = SQLite.openDatabaseSync('app.db');
export const db = drizzle(sqlite);
```

## ABSOLUTE NO
- Never store auth tokens in AsyncStorage or MMKV (no encryption at rest)
- Never put images in expo-sqlite (use expo-file-system)
- Don't pick CoreData via native bridge unless you specifically need NSPersistentCloudKitContainer features

More AI & ML skills

← All AI & ML skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY