How tencent/mmkv works
Project type and purpose
• This is an open-source, cross-platform key-value storage library (“MMKV”) implemented in C++ (“Core”) and exposed on multiple platforms (Android, iOS/macOS, Windows, POSIX, HarmonyOS), with language/interface bindings (Java, Objective-C/Swift, C#, Python, Dart, JavaScript/TypeScript).
• Purpose: ultra-fast, memory-mapped key-value store for mobile/desktop/native apps, used by WeChat and others.
File structure
• Top-level “Core” directory: pure C++ engine (memory‐map handling, protobuf encoding, process locks, CRC, AES).
• Per-platform folders:
• Android/MMKV & mmkvannotation & mmkvdemo (Java API, JNI glue, CMake build, demos)
• iOS/MMKV & MMKVDemo (Objective-C++ static/dynamic libs, Xcode projects, demo apps)
• Win32 (Visual Studio solution, demos)
• POSIX (CMake, C++ shared/static lib, Go bridge, demo)
• OpenHarmony (TS/ETS frontends, N-API/native bridge, CMake)
• Python (pybind11 wrapper, setup.py, demo)
• Flutter & flutter plugins (Dart API, platform channels, native code for iOS/Android/OhOS)
• Build scripts and packaging: CMakeLists, Gradle (.gradle/, settings.gradle), Podspec, hvigorfile.ts, Makefile, Dockerfile.
README for additional insights
• Confirms multi-platform support, core features (mmap + protobuf), multi-process concurrency, per-platform installation steps, demos/tutorials.
Diagramming conventions
• Green for Core
• Blue for platform bindings
• Orange for client/demo apps
• Gray for build tools & OS services