简体   繁体   English

存储应用程序数据并将其加载到应用程序中的最佳方式是什么?

[英]What is the best way to store app data and load it in app?

This is just a information question.这只是一个信息问题。 I'm new to Android app development and currently I'm working on my first app and and it is ready for the release.我是 Android 应用程序开发的新手,目前我正在开发我的第一个应用程序,它已准备好发布。 Now I'm concerned about how to handle heap of users and where to save all their details my app is a service booking app so it needs to save all the order details products details and lots other stuff.现在我关心如何处理大量用户以及在哪里保存他们的所有详细信息我的应用程序是一个服务预订应用程序,因此它需要保存所有订单详细信息产品详细信息和许多其他内容。

Currently I'm using cloud firestore to load and save all the data of app.目前我正在使用 cloud firestore 来加载和保存应用程序的所有数据。 But I'm having some issues like without authentication it won't allow users to access some of my data and other.但是我遇到了一些问题,比如没有身份验证,它不允许用户访问我的一些数据和其他数据。 I wonder how large apps save their data and load them perfectly.我想知道大型应用程序如何保存数据并完美加载它们。

I wish someone will help me how can I save all my app data and load them perfectly in app.我希望有人能帮助我如何保存我所有的应用程序数据并将它们完美地加载到应用程序中。 And suggest me for a best way to manage large user base.并建议我管理大量用户群的最佳方式。 And other stuff.和其他东西。

First of all, firestore is good option if you don't have complex backend logic on the database.首先,如果您的数据库没有复杂的后端逻辑,firestore 是一个不错的选择。 For simple CRUD operations on data firestore is a good choice but as you said you have a bulk of data then you must go for the Backend database and then connect your database with Rest API.对于数据 Firestore 上的简单 CRUD 操作是一个不错的选择,但正如您所说,您有大量数据,那么您必须 go 用于后端数据库,然后将您的数据库与 Rest ZDB974238714CA8DE634A7CE1D08 连接。 So that all your complex queries will be done on the backend and you can simply consume your API in the app.这样您所有的复杂查询都将在后端完成,您只需在应用程序中使用您的 API。

If you have lots of data from different users, maybe you should use a central server(DB), something like Postgres or MySQL should work fine.如果您有来自不同用户的大量数据,也许您应该使用中央服务器(DB),例如 Postgres 或 MySQL 应该可以正常工作。

At the same time, you can also do some sort of caching to accelerate the fetching process, like create a small database locally(you can useRoom ) to store some user specific data.同时,你也可以做一些缓存来加速获取过程,比如在本地创建一个小型数据库(你可以使用Room )来存储一些用户特定的数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM