GithubHelp home page GithubHelp logo

connectedbits / react-native-mmkv-storage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ammarahm-ed/react-native-mmkv-storage

1.0 1.0 0.0 2.86 MB

An ultra fast (0.0002s read/write), small & encrypted mobile key-value storage framework for React Native written in C++ using JSI

Home Page: https://rnmmkv.now.sh

License: MIT License

Java 5.75% JavaScript 6.12% Objective-C 2.78% Ruby 0.22% Starlark 0.10% CMake 0.89% C++ 65.54% Objective-C++ 6.60% Assembly 6.56% C 5.46%

react-native-mmkv-storage's Introduction

react-native-mmkv-storage

License: MIT Android iOS

An efficient, small & encrypted mobile key-value storage framework for React Native written in C++ using JSI

What it is

This library aims to provide a fast & reliable solution for you data storage needs in react-native apps. It uses MMKV by Tencent under the hood on Android and iOS both that is used by their WeChat app(more than 1 Billion users). Unlike other storage solutions for React Native, this library lets you store any kind of data type, in any number of database instances, with or without encryption in a very fast and efficient way. Read about it on this blog post I wrote on dev.to

Features

  • Written in C++ using JSI
    Starting from v0.5.0 the library has been rewritten in C++ on Android and iOS both. It employs React Native JSI making it the fastest storage option for React Native.
  • Simple and lightweight
    (~ 50K Android/30K iOS) and even smaller when packaged.
  • Fast and Efficient (0.0002s Read/Write Speed)
    MMKV uses mmap to keep memory synced with file, and protobuf to encode/decode values to achieve best performance. You can see the benchmarks here: Android & iOS
  • Reactive using useMMKVStorage Hook
    Starting from v0.5.5, thanks to the power of JSI, we now have our very own useMMKVStorage Hook. Think of it like a persisted state that will always write every change in storage and update your app UI instantly. It doesn't matter if you reload the app or restart it.
  • Multi-Process Support
    MMKV supports concurrent read-read and read-write access between processes.
  • Create unlimited Database instances
    You can create many database instances. This helps greatly if you have seperate logics/modules in the same app that use data differently, It also helps in better performance since each database instance is small instead of a single bulky database which makes things slower as it grows.
  • Full encryption support
    The library supports full encryption on Android and iOS. You can choose to store your encryption key securely for continuious usage. The library uses Keychain on iOS and Android Keystore on android (API 23 and above). On android for lower api levels (API 22 and below), it uses secure prefrences which provides not perfect but incremental security on older Android APIs.
  • Simple indexer and data querying
    For each database instance, there is one global key index and then there are indexes of each type of data. So querying is easy and fast.
  • Supports redux-persist
    Support for redux persist is also added starting from v0.3.2.

Links

Quickstart

Contact & Support

  • Create a GitHub issue for bug reports, feature requests, or questions
  • Follow @ammarahm-ed for announcements
  • Add a ⭐️ star on GitHub or ❤️ tweet to support the project!

RoadMap

You can track the upcoming features, changes and the future of this library in this issue

I want to contribute

That is awesome news! There is alot happening at a very fast pace in this library right now. Every little help is precious. You can contribute in many ways:

  • Suggest code improvements on native iOS and Android
  • If you have suggestion or idea you want to discuss, open an issue.
  • Open an issue if you want to make a pull request, and tell me what you want to improve or add so we can discuss
  • I am always open to new ideas

License

This library is licensed under the MIT license.

Copyright © Ammar Ahmed (@ammarahm-ed)

react-native-mmkv-storage's People

Contributors

ammarahm-ed avatar michaelvilleneuve avatar r0b0t3d avatar saltedblowfish avatar frw avatar kyle-ssg avatar focux avatar mateosilguero avatar mmapplebeck avatar bill2004158 avatar laffed avatar yunusemredilber avatar zfanta avatar

Stargazers

Seyat Seyhan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.