简体   繁体   中英

Json files vs DB table for get value

I am trying to get value like key and value pair but i am doing it from json file and now there is another approach suggested lets do it from db tables. because if in future value change then only update the DB is Needed. I think using json file is more good as value hardly going to change in future(rarest of rare).. although advantage of db approach is just change the db value and done...

So My point is json will be faster then DB and Using Json will reduce load on DB..as clicking UI it invoke extra call of DB..

What do you Think .. Please let me know..

This very much depends on how you are going to use these data.

Do you need to update it often? Do you need to update by just one specific field? Do you need to fetch records based on some specific field? Do you need to fetch whole json or just some specific fields? Do some parts of json reference any other tables?

Also, consider the size of those data, eg if the json files together may become more in size than the whole other tables, you may break db cache. From the other hand, you can always create separate database for your json files if you still need some relational database features.

So, I would anyway start with answering first 5 questions.

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