哪种存储静态数据的方法更好? [英] Which approach to store static data is better?

查看:165
本文介绍了哪种存储静态数据的方法更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发有关书籍的网络应用程序。我们都知道书有不同的类别。所以,这个类别是一个数字序列的基础,例如200 =计算机相关,800 =历史。每本书只有一个类别。



这是问题。我有一个类别列表,它可能在未来扩大。例如,出现新技术,并将创建新的类别。那么我该怎么办?在数据库中?还是一个简单的XML文件?因为它并没有改变,所以,我认为这将成为数据库中存储的浪费? thz u。

解决方案

对我来说,最好的决定是使用数据库进行存储。你不知道你的项目之后会有什么变化。此外,如果数据进入数据库,您可以轻松地更新它们并添加相关的附加信息。但这取决于。你知道你有什么样的项目和你正在使用的技术。



也许XML也是一个不错的选择。您可以相对容易地添加新数据并选择当前的数据,然后在项目中使用它们。



但我的建议是使用数据库。类别不是要存储的数据太多。它的灵活性更强大。


I am developing a web application about books. We all knows that books have different category. So, this category is basic on a sequence of number, for example, 200 = computer related, 800 = history. Each book is beyond to one category only.

Here is the question. I have a category list, it may expand in the future. For example, new technology is appear, and new category will be created. So, what should I store this category? In a database? or a simple XML file? Because it is not alter all the time, so, I am think will it become a waste to store in database? thz u.

解决方案

For me, the best decision is to use the database for storing. You don't know what changes will follow your project after time. Also if the data are into the database, you can easy update them and add related additional info. But it depends. You know better what kind of project you have and what technologies you are using.

Maybe XML is also a good choice. You can relatively easy to add new data and to selects the current one and then to use them in your project.

But my advice is to use Database. The categories are not too much data to be stored. It's far more flexible and powerful.

这篇关于哪种存储静态数据的方法更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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