简体   繁体   中英

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. 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.

So just wanted to know the better approach to store these kind of data in 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 .
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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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