当使用一个数据库? [英] When to use a database?

查看:144
本文介绍了当使用一个数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近有​​问题与删除了一些全局变量系统。从答案,我已经明白,内存中的数据可以通过系统随时删除,这是更好地使用数据库来存储数据。

I recently had an issue with some global variables deleted by the system. From the answers I've understood that data in memory can be deleted anytime by the system, and that it's better to use a database to store the data.

不过,我经常工作的应用与经常变化的数据,这些数据通过Web服务从大型数据库加载它们的数据。例如。项的目录,许多类别,其中用户浏览只有一个非常小的一部分。在这种情况下,数据库似乎没有道理给我,因为

However, I'm often working on applications with frequently changing data, which load their data from huge databases via web-services. E.g. a catalog of items with many categories, in which the user browses only a very small part. In that case a database doesn't seem to make sense to me, since


  1. 网络服务通常提供由块中的数据(按类别,网页...)并遍历所有的类别和页面填写申请DB是没有意义的,而

  2. 数据经常变化,所以必须重新加载每次启动应用程序,所以我们并不需要真正的持久性数据。

在这种情况下,是不是最好使用一个缓存,以检查数据依然存在,如果它不然后重新加载数据?从答案​​我的问题似乎是不好的设计,和我不知道我理解为什么...

In that case, isn't it better to use a cache, to check if the data still exists, and if it's not then reload the data? From the answers to my question it seems that it's bad design, and I'm not sure I understand why...

推荐答案

使用您的内部数据存储,创建/读/写/使用自己的文件,在 /数据/ 目录。

Use your internal data storage, create/write/read/use your own files in your /data/ directory.

它位于: /data/data/com.your_domain.YourAppName/from_here_is_your_internal_storage

这篇关于当使用一个数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆