简体   繁体   English

将数据保存在SQL或服务器上

[英]save data on SQL or on the server

I have been working recently on an app and I reached a crossroad... I am new to this so, you might find my question trivial. 我最近一直在开发一个应用程序,但是遇到了一个十字路口……我对此并不陌生,所以,您可能会发现我的问题微不足道。

In the app we have a certain data we are using that we have saved in the server, this data is not user specific but, general to all users and is vital for the functionality of the app. 在应用程序中,我们有一些正在使用的数据已经保存在服务器中,该数据不是特定于用户的,而是所有用户通用的,对于应用程序的功能至关重要。 This data will be updated from time to time. 此数据将不时更新。

So, my question is: 所以,我的问题是:

From your experience would it be more practical to save all the data using SQL or to keep the data on the server and keep requesting it frequently? 根据您的经验,使用SQL保存所有数据或将数据保留在服务器上并经常请求它会更实用吗?

From my experience, it really depends on what type of data it is. 根据我的经验,这实际上取决于它是什么类型的数据。

Since this data is vital for the functionality of your app, that means you should keep the vital portions of the data cached locally in your app. 由于此数据对于应用程序的功能至关重要,因此这意味着您应将数据的重要部分保留在应用程序本地缓存中。 This is to avoid cases where users can't use your app during times when they lose connection to the internet. 这是为了避免在用户失去与互联网的连接时无法使用您的应用的情况。

So typically, it would be a good idea to store enough data in a local database for users to use your app. 因此,通常,将足够的数据存储在本地数据库中供用户使用您的应用程序是一个好主意。 But if the data is very sensitive and shouldn't be easily tampered with, then you would want to store it only on your server instead. 但是,如果数据非常敏感并且不应该轻易被篡改,那么您只想将其存储在服务器上即可。

But still, it depends on what type of data. 但是,这仍然取决于哪种数据类型。 If it's data that has no specific need to be on your own servers and it's just meant for the user to use their app, then storing it locally is enough. 如果没有特定需要的数据存储在您自己的服务器上,并且仅是供用户使用其应用程序,则将其存储在本地就足够了。

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

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