MMKV alternatives and similar libraries
Based on the "Database" category.
Alternatively, view MMKV alternatives based on common mentions on social networks and blogs.
-
YapDatabase
YapDB is a collection/key/value store with a plugin architecture. It's built atop sqlite, for Swift & objective-c developers. -
ParseAlternatives
DISCONTINUED. GraphQLite is a toolkit to work with GraphQL servers easily. It also provides several other features to make life easier during iOS application development. [Moved to: https://github.com/relatedcode/GraphQLite] -
Unrealm
Unrealm is an extension on RealmCocoa, which enables Swift native types to be saved in Realm. -
Prephirences
Prephirences is a Swift library that provides useful protocols and convenience methods to manage application preferences, configurations and app-state. UserDefaults -
PredicateEditor
A GUI for dynamically creating NSPredicates at runtime to query data in your iOS app. -
realm-cocoa-converter
A library that provides the ability to import/export Realm files from a variety of data container formats. -
SecureDefaults
Elevate the security of your UserDefaults with this lightweight wrapper that adds a layer of AES-256 encryption -
MySQL
A stand-alone Swift wrapper around the MySQL client library, enabling access to MySQL servers. -
PersistenceKit
Store and retrieve Codable objects to various persistence layers, in a couple lines of code! -
PersistentStorageSerializable
Swift library that makes easier to serialize the user's preferences (app's settings) with system User Defaults or Property List file on disk. -
ObjectiveRocks
An Objective-C wrapper for RocksDB - A Persistent Key-Value Store for Flash and RAM Storage. -
MongoDB
A stand-alone Swift wrapper around the mongo-c client library, enabling access to MongoDB servers. -
PostgreSQL
A stand-alone Swift wrapper around the libpq client library, enabling access to PostgreSQL servers. -
FileMaker
A stand-alone Swift wrapper around the FileMaker XML Web publishing interface, enabling access to FileMaker servers.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of MMKV or a related project?
Popular Comparisons
README
δΈζηζ¬θ―·εη[θΏι](./README_CN.md)
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, Win32 and POSIX.
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
, noapply
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:1.2.14'
// replace "1.2.14" with any available version
}
Starting from v1.2.8, MMKV has been migrated to Maven Central.
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:
public void onCreate() {
super.onCreate();
String rootDir = MMKV.initialize(this);
System.out.println("mmkv root: " + rootDir);
//β¦β¦
}
MMKV has a global instance, that can be used directly:
import com.tencent.mmkv.MMKV;
MMKV kv = MMKV.defaultMMKV();
kv.encode("bool", true);
boolean bValue = kv.decodeBool("bool");
kv.encode("int", Integer.MIN_VALUE);
int iValue = kv.decodeInt("int");
kv.encode("string", "Hello from mmkv");
String str = kv.decodeString("string");
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, runpod 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 *mmkv = [MMKV defaultMMKV];
[mmkv setBool:YES forKey:@"bool"];
BOOL bValue = [mmkv getBoolForKey:@"bool"];
[mmkv setInt32:-1024 forKey:@"int32"];
int32_t iValue = [mmkv getInt32ForKey:@"int32"];
[mmkv setString:@"hello, mmkv" forKey:@"string"];
NSString *str = [mmkv getStringForKey:@"string"];
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 Win32
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
, nosync
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
Win32/MMKV/MMKV.vcxproj
to your solution; - Add
MMKV
project to your project's dependencies; - Add
$(OutDir)include
to your project'sC/C++
->General
->Additional Include Directories
; - Add
$(OutDir)
to your project'sLinker
->General
->Additional Library Directories
; - Add
MMKV.lib
to your project'sLinker
->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 usesMD/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 Win32 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:
#include <MMKV/MMKV.h>
int main() {
std::wstring rootDir = getYourAppDocumentDir();
MMKV::initializeMMKV(rootDir);
//...
}
MMKV has a global instance, that can be used directly:
auto mmkv = MMKV::defaultMMKV();
mmkv->set(true, "bool");
std::cout << "bool = " << mmkv->getBool("bool") << std::endl;
mmkv->set(1024, "int32");
std::cout << "int32 = " << mmkv->getInt32("int32") << std::endl;
mmkv->set("Hello, MMKV for Win32", "string");
std::string result;
mmkv->getString("string", result);
std::cout << "string = " << result << std::endl;
MMKV also supports Multi-Process Access. Full tutorials can be found here Win32 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
, nosync
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.
Getting Started
Installation Via CMake
- Getting source code from the git repository:
git clone https://github.com/Tencent/MMKV.git
Edit your
CMakeLists.txt
, add those lines:add_subdirectory(mmkv/POSIX/src mmkv) target_link_libraries(MyApp mmkv)
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:
#include "MMKV.h"
int main() {
std::string rootDir = getYourAppDocumentDir();
MMKV::initializeMMKV(rootDir);
//...
}
MMKV has a global instance, that can be used directly:
auto mmkv = MMKV::defaultMMKV();
mmkv->set(true, "bool");
std::cout << "bool = " << mmkv->getBool("bool") << std::endl;
mmkv->set(1024, "int32");
std::cout << "int32 = " << mmkv->getInt32("int32") << std::endl;
mmkv->set("Hello, MMKV for Win32", "string");
std::string result;
mmkv->getString("string", result);
std::cout << "string = " << result << std::endl;
MMKV also supports Multi-Process Access. Full tutorials can be found here POSIX Tutorial.
License
MMKV is published under the BSD 3-Clause license. For details check out the [LICENSE.TXT](./LICENSE.TXT).
Change Log
Check out the [CHANGELOG.md](./CHANGELOG.md) for details of change history.
Contributing
If you are interested in contributing, check out the [CONTRIBUTING.md](./CONTRIBUTING.md), also join our Tencent OpenSource Plan.
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](./CODE_OF_CONDUCT.md).
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.
*Note that all licence references and agreements mentioned in the MMKV README section above
are relevant to that project's source code only.