finds.dev← search

// the find

Tencent/MMKV

★ 18,692 · C++ · NOASSERTION · updated Jul 2026

An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, POSIX, and OHOS.

MMKV is a key-value storage library from the WeChat team that replaces SharedPreferences on Android and NSUserDefaults on iOS. It uses mmap for persistence and protobuf for encoding, which makes synchronous writes fast enough that you don't need to batch or defer them. The multi-platform reach (Android, iOS, macOS, Windows, POSIX, HarmonyOS) comes from a shared C++ core with thin platform wrappers.

The mmap + append-only write design means a write is effectively a memory write flushed by the OS — no fsync, no background thread, no 'apply vs commit' footgun like SharedPreferences. Multi-process support is a first-class feature with proper file locking, not an afterthought. The binary size footprint is genuinely small (7–50KB depending on platform), which matters in mobile contexts. The codebase is battle-tested at WeChat scale with years of production history behind it.

The storage format is append-only with periodic compaction, so a file that sees heavy churn will grow until compaction runs — the compaction heuristic is not user-controllable. There's no built-in encryption key rotation; if you initialize with AES encryption and later need to re-key, you're on your own. The Windows setup still requires adding source directly to your solution and matching MT/MD runtime flags manually — no NuGet, no CMake fetch. Dropping 32-bit Android support in v2.0 was a clean break with no shim, so projects targeting old low-end devices are stuck on v1.3.x LTS indefinitely.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →