当前位置: 首页 > 软件库 > 手机/移动开发 > >

react-native-mmkv-storage

授权协议 MIT License
开发语言 Java
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 寿翰飞
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

react-native-mmkv-storage

AndroidiOS

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

Learn how to build your own module with JSI in this blog

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 & useIndex 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)

Notesnook Logo
 相关资料
  • MMKV The fastest key/value storage for React Native. MMKV is an efficient, small mobile key-value storage framework developed by WeChat. See Tencent/MMKV for more information react-native-mmkv is a li

  • MMKV——基于 mmap 的高性能通用 key-value 组件 MMKV 是基于 mmap 内存映射的 key-value 组件,底层序列化/反序列化使用 protobuf 实现,性能高,稳定性强。从 2015 年中至今,在 iOS 微信上使用已有近 3 年,其性能和稳定性经过了时间的验证。近期也已移植到 Android 平台,一并开源。 MMKV 源起 在微信客户端的日常运营中,时不时就会爆

  • 本文向大家介绍react-native 启动React Native Packager,包括了react-native 启动React Native Packager的使用技巧和注意事项,需要的朋友参考一下 示例 在最新版本的React Native上,无需运行打包程序。它将自动运行。 默认情况下,这将在端口8081上启动服务器。要指定服务器所在的端口            

  • 百度移动统计SDK支持使用react native框架的H5页面统计,封装好的插件已经在github上开源,相关用法具体请参考:https://github.com/BaiduMobileAnalysis/baidumobstat-react-native。

  • The React Native environment has a lot of little quirks, so this documentation is aimed at helping smooth those over. Please feel free to create issues on GitHub for recommendations and additions to t

  • React Native 可以基于目前大热的开源JavaScript库React.js来开发iOS和Android原生App。而且React Native已经用于生产环境——Facebook Groups iOS 应用就是基于它开发的。 React Native的原理是在JavaScript中用React抽象操作系统原生的UI组件,代替DOM元素来渲染,比如以<View>取代<div>,以<Ima