本文介绍了在 React Native 中存储来自 json api 的大数据集合的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要制作一个可以离线使用的应用程序,它可以从 json api 获取大约 10,000 个对象(估计 10mb 数据)并将它们存储在本地,以便在没有互联网连接时可以使用它们.

I need to make an offline capable app that can fetch about 10,000 objects (est. 10mb data) from a json api and store them locally so they can be used when there is no internet connection.

我看过 react-native-sqlite-storage (https://github.com/andpor/react-native-sqlite-storage).这是最好的选择还是有更好的选择?

I have looked at react-native-sqlite-storage (https://github.com/andpor/react-native-sqlite-storage). Is that the best option or are there better alternatives?

推荐答案

根据我的研究,我发现以下可用于 React Native 应用程序的开源 SQLite 插件:

Based on my research, I have found below open source SQLite plugins which are available for React Native apps:

https://github.com/almost/react-native-sqlite

https://github.com/andpor/react-native-sqlite-存储

https://github.com/jbrodriguez/react-native-android-sqlite

https://github.com/ramsundark5/react-native-sqlite3

https://github.com/remobile/react-native-sqlite

如果您只想存储数据,那么我建议使用文件存储.但是如果你想以 RDBMS 的形式存储数据,那么你可以使用上述插件之一.

If you just want to store your data, then I would recommend to use file storage. But if you want to store data in form of RDBMS then you can use one of the above plugin.

这篇关于在 React Native 中存储来自 json api 的大数据集合的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!