MMKV vs SQLite
MMKV: Tencent's mmap-backed key-value store for mobile apps, built as a faster SharedPreferences/NSUserDefaults. SQLite: The in-process SQL engine that ships in every phone, browser and OS: one file, zero servers.
key differences
- MMKV is primarily a key-value database; SQLite is relational.
- Transactions: MMKV offers none ACID; SQLite offers full.
- Only MMKV has ttl / expiry, encryption at rest.
- Only SQLite has transactions, joins, secondary indexes, full-text search, json.
choose mmkv for
- +Replacing SharedPreferences, NSUserDefaults or AsyncStorage
- +Feature flags and user settings
- +Small session and token caches on device
best at · Embedded, Coordination, Cache
choose sqlite for
- +Mobile and desktop application storage
- +Embedded devices and IoT
- +Local-first apps and offline caches
- +Test fixtures and data interchange files
best at · Embedded, Mobile/offline, Edge
MMKV vs SQLite: FAQ
What is the difference between MMKV and SQLite?
MMKV: Tencent's mmap-backed key-value store for mobile apps, built as a faster SharedPreferences/NSUserDefaults. SQLite: The in-process SQL engine that ships in every phone, browser and OS: one file, zero servers. MMKV is primarily a key-value database; SQLite is relational. Transactions: MMKV offers none ACID; SQLite offers full. Only MMKV has ttl / expiry, encryption at rest.
When should I choose MMKV over SQLite?
Choose MMKV for replacing SharedPreferences, NSUserDefaults or AsyncStorage; feature flags and user settings; and small session and token caches on device. Choose SQLite for mobile and desktop application storage; embedded devices and IoT; and local-first apps and offline caches.
Is MMKV or SQLite more popular?
SQLite ranks #5 on the WhichDB Score (75.5/100) and MMKV ranks #364 (6.3/100). Popularity is not fit: check the requirements that matter for your project.
Are MMKV and SQLite open source?
Yes. MMKV is open source. License: BSD 3-Clause License. Yes. SQLite is open source. License: Public Domain.