Tencent/MMKV — a mobile project — sits at 18.7k GitHub stars in the Mobile space. An efficient, small mobile key-value storage framework developed by WeChat. Works on Android, iOS, macOS, Windows, POSIX, and OHOS.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
MMKV is an efficient, small, easy-to-use mobile key-value storage framework used in the WeChat application. It's currently available on Android, iOS/macOS, Windows, POSIX and HarmonyOS NEXT, with experimental Kotlin Multiplatform support.
MMKV for Kotlin Multiplatform
The v2.4.2 Kotlin Multiplatform package is experimental and currently targets
Android and iOS. Its API and artifact layout may change in a future release.
Add it to the shared module:
Supported targets are Android, iosArm64, iosSimulatorArm64, and iosX64. See the Kotlin Multiplatform guide for initialization and packaging details.
MMKV for Android
Features
Efficient. MMKV uses mmap to keep memory synced with files, and protobuf to encode/decode values, making the most of Android to achieve the best performance.
Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.
Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no sync, no apply calls needed.
Small.
A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics, and nothing more. It's really tidy.
About 50K in binary size: MMKV adds about 50K per architecture on App size, and much less when zipped (APK).
Getting Started
Installation Via Maven
Add the following lines to build.gradle on your app module:
dependencies {
implementation 'com.tencent:mmkv:2.4.2'
// replace "2.4.2" with any available version
}
Starting from v2.0.0, MMKV no longer supports 32-bit arch and API level 22 or 21, if you want 32-bit or API level 21~22, use v1.3.x LTS series.
For other installation options, see Android Setup.
Quick Tutorial
You can use MMKV as you go. All changes are saved immediately, no sync, no apply calls needed.
Setup MMKV on App startup, say your Application class, add these lines:
MMKV also supports Multi-Process Access. Full tutorials can be found here Android Tutorial.
Performance
Writing random int for 1000 times, we get this chart:
For more benchmark data, please refer to our benchmark.
MMKV for iOS/macOS
Features
Efficient. MMKV uses mmap to keep memory synced with files, and protobuf to encode/decode values, making the most of iOS/macOS to achieve the best performance.
Easy-to-use. You can use MMKV as you go, no configurations are needed. All changes are saved immediately, no synchronize calls are needed.
Small.
A handful of files: MMKV contains encode/decode helpers and mmap logics and nothing more. It's really tidy.
Less than 30K in binary size: MMKV adds less than 30K per architecture on App size, and much less when zipped (IPA).
Getting Started
Installation Via CocoaPods:
Install CocoaPods;
Open the terminal, cd to your project directory, run pod repo update to make CocoaPods aware of the latest available MMKV versions;
Edit your Podfile, add pod 'MMKV' to your app target;
Run pod install;
Open the .xcworkspace file generated by CocoaPods;
Add #import <MMKV/MMKV.h> to your source file and we are done.
For other installation options, see iOS/macOS Setup.
Quick Tutorial
You can use MMKV as you go, no configurations are needed. All changes are saved immediately, no synchronize calls are needed.
Setup MMKV on App startup, in your -[MyApp application: didFinishLaunchingWithOptions:], add these lines:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// init MMKV in the main thread
[MMKV initializeMMKV:nil];
//...
return YES;
}
MMKV has a global instance, that can be used directly:
MMKV also supports Multi-Process Access. Full tutorials can be found here.
Performance
Writing random int for 10000 times, we get this chart:
For more benchmark data, please refer to our benchmark.
MMKV for Windows
Features
Efficient. MMKV uses mmap to keep memory synced with files, and protobuf to encode/decode values, making the most of Windows to achieve the best performance.
Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.
Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no save, no sync calls are needed.
Small.
A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics, and nothing more. It's really tidy.
About 10K in binary size: MMKV adds about 10K on application size, and much less when zipped.
Getting Started
Installation Via Source
Getting source code from git repository:
git clone https://github.com/Tencent/MMKV.git
Add Core/core.vcxproj to your solution;
Add MMKV project to your project's dependencies;
Add $(OutDir)include to your project's C/C++ -> General -> Additional Include Directories;
Add $(OutDir) to your project's Linker -> General -> Additional Library Directories;
Add mmkv.lib to your project's Linker -> Input -> Additional Dependencies;
Add #include <MMKV/MMKV.h> to your source file and we are done.
note:
MMKV is compiled with MT/MTd runtime by default. If your project uses MD/MDd, you should change MMKV's setting to match your project's (C/C++ -> Code Generation -> Runtime Library), or vice versa.
MMKV is developed with Visual Studio 2017, change the Platform Toolset if you use a different version of Visual Studio.
For other installation options, see Windows Setup.
Quick Tutorial
You can use MMKV as you go. All changes are saved immediately, no sync, no save calls needed.
Setup MMKV on App startup, say in your main(), add these lines:
MMKV also supports Multi-Process Access. Full tutorials can be found here Windows Tutorial.
MMKV for POSIX
Features
Efficient. MMKV uses mmap to keep memory synced with files, and protobuf to encode/decode values, making the most of POSIX to achieve the best performance.
Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.
Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no save, no sync calls are needed.
Small.
A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics, and nothing more. It's really tidy.
About 7K in binary size: MMKV adds about 7K on application size, and much less when zipped.
Add #include "MMKV.h" to your source file and we are done.
For other installation options, see POSIX Setup.
Quick Tutorial
You can use MMKV as you go. All changes are saved immediately, no sync, no save calls needed.
Setup MMKV on App startup, say in your main(), add these lines:
MMKV also supports Multi-Process Access. Full tutorials can be found here POSIX Tutorial.
MMKV for HarmonyOS NEXT
Features
Efficient. MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values, making the most of native platform to achieve best performance.
Multi-Process concurrency: MMKV supports concurrent read-read and read-write access between processes.
Easy-to-use. You can use MMKV as you go. All changes are saved immediately, no sync, no flush calls needed.
Small.
A handful of files: MMKV contains process locks, encode/decode helpers and mmap logics and nothing more. It's really tidy.
About 600K in binary size: MMKV adds about 600K per architecture on App size, and much less when zipped (HAR/HAP).
Getting Started
Installation via OHPM:
ohpm install @tencent/mmkv
Quick Tutorial
You can use MMKV as you go. All changes are saved immediately, no sync, no apply calls needed.
Setup MMKV on App startup, say your EntryAbility.onCreate() function, add these lines:
import { MMKV } from '@tencent/mmkv';
export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
let appCtx = this.context.getApplicationContext();
let mmkvRootDir = MMKV.initialize(appCtx);
console.info('mmkv rootDir: ', mmkvRootDir);
……
}
MMKV has a global instance, that can be used directly:
import { MMKV } from '@tencent/mmkv';
let mmkv = MMKV.defaultMMKV();
mmkv.encodeBool('bool', true);
console.info('bool = ', mmkv.decodeBool('bool'));
mmkv.encodeInt32('int32', Math.pow(2, 31) - 1);
console.info('max int32 = ', mmkv.decodeInt32('int32'));
mmkv.encodeInt64('int', BigInt(2**63) - BigInt(1));
console.info('max int64 = ', mmkv.decodeInt64('int'));
let str: string = 'Hello OpenHarmony from MMKV';
mmkv.encodeString('string', str);
console.info('string = ', mmkv.decodeString('string'));
let arrayBuffer: ArrayBuffer = StringToArrayBuffer('Hello OpenHarmony from MMKV with bytes');
mmkv.encodeBytes('bytes', arrayBuffer);
let bytes = mmkv.decodeBytes('bytes');
console.info('bytes = ', ArrayBufferToString(bytes));
As you can see, MMKV is quite easy to use.
For the full documentation, see HarmonyOS NEXT Tutorial.
License
MMKV is published under the BSD 3-Clause license. For details check out the LICENSE.TXT.
Change Log
Check out the CHANGELOG.md for details of change history.
Contributing
If you are interested in contributing, check out the CONTRIBUTING.md, also join our Tencent OpenSource Plan. MMKV has officially joined the Tencent Device-oriented Service Product Alliance, working together with other alliance members to build an open and mutually beneficial frontend technology product ecosystem.
To give clarity of what is expected of our members, MMKV has adopted the code of conduct defined by the Contributor Covenant, which is widely used. And we think it articulates our values well. For more, check out the Code of Conduct.
FAQ & Feedback
Check out the FAQ first. Should there be any questions, don't hesitate to create issues.
Personal Information Protection Rules
User privacy is taken very seriously: MMKV does not obtain, collect or upload any personal information. Please refer to the MMKV SDK Personal Information Protection Rules for details.
No homepage URL was recorded for Tencent/MMKV in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
How active is development on Tencent/MMKV?
The most recent commit recorded on Tencent/MMKV was 1 month ago, based on the GitHub push timestamp. The repository has 2.0k forks — one of the better signals of community interest.
How many stars does Tencent/MMKV have?
Tencent/MMKV has 18.7k GitHub stars — refresh the page for the live number, or check github.com/Tencent/MMKV. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is Tencent/MMKV written in?
Tencent/MMKV is written primarily in C++. GitHub's language field is based on the largest share of bytes in the default branch.
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/Tencent/MMKV is the definitive source.
Read full README in the tab above.
Is MMKV worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of MMKV.