简体   繁体   English

数据库存储配置日期的最佳可能结构是什么

[英]What is the best possible structure for a db to store configurations date

I have a requirement where i need to store different application config data , so just wanted to know the best possible way to to store it. 我有一个需要存储不同应用程序配置数据的要求,所以只想知道存储它的最佳方法。

Currently I am using below fields for my db 目前,我正在为我的数据库使用以下字段

id, name ,category ,city,value(text field), int_value, float_value, string_value,date_value,bool_value

value field will be used to store complex data which in turn are json object capable of storing different key value pair. 值字段将用于存储复杂数据,这些数据又是能够存储不同键值对的json对象。 for eg. 例如

value: 值:

{ "is_enabled" : true,
 "list_of_applicable_ids" : ["123","345","567","890"]
}

And the reason I have added different value data type field(int_value, float_value) because it will be easy to query on that fields and index will make this even faster. 我之所以添加不同的值数据类型字段(int_value,float_value),是因为在该字段上查询将很容易,而索引将使其更快。

So just wanted to know the better approach to store these kind of data in db. 因此,只想知道在db中存储此类数据的更好方法。 will using only value fields enough for my requirements ? 是否仅使用字段足以满足我的要求? Frequency of config changes are very less( once or twice in a month) 配置更改的频率非常少(每月一次或两次)

Take a look a file based databases. 看一下基于文件的数据库。
An example would be MongoDB . 一个例子是MongoDB
Mongo uses a data form that closely resembles JSON (called BSON), and could in your case store the entire config file without the need to predefined it's fields. Mongo使用与JSON非常相似的数据格式(称为BSON),并且在您的情况下可以存储整个配置文件,而无需预定义其字段。

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

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