Fast key-value storage for mobile and desktop apps, from WeChat
open sourceBSD-3-Clausefree
MMKV is a small key-value storage library made by Tencent for the WeChat app. It keeps values in memory-mapped files and encodes them with protobuf, so every write is saved at once with no sync or apply call, and on Android, Windows and POSIX systems several processes can read and write the same store. It ships for Android (Maven), iOS and macOS (CocoaPods and Swift Package Manager), Windows, POSIX systems and HarmonyOS NEXT, with experimental Kotlin Multiplatform support.
Problems it solves
- SharedPreferences is slow and loses data when my Android app crashes
- fast local key-value storage for an iOS app instead of UserDefaults
- share small settings between processes of my Android app
Features
- key-value storage for mobile apps that saves every write at once
- memory-mapped files with protobuf encoding
- multi-process access on Android, Windows and POSIX
- adds about 30K to an iOS app and 50K per architecture to an Android app
Limitations
Alternatives
The same job
These do what MMKV does.
- Realm Open source object database that runs inside mobile apps
