Home > Software design >  Can a JSON file be used as database?
Can a JSON file be used as database?

Time:08-28

Theorically i have a group (2000 - 3000) of data structure it's a local obituary project, with 5 item/value for each (name, birth, death, function, photo url) and i want :

  • to load this data in html page,
  • format each data into styled div,
  • allow user to filter (name, function etc) these divs (hide/show) via js or jquery and inputs

i know the best way to do this is mysql php, but since i have no knowledge yet in this field My question is :

  • Is it correct to use a json file to store these data and populate divs ?
  • can we filter json data with jquery ?

Thanks

CodePudding user response:

Define database. Can it be used to store data? Yes. But it has no search abilities, it isn't ACID compliant, and accessing it would run in the current process. Any non-trivial filtering would require an O(N) process, unless you're going to build index tables in memory. It would also be nearly impossible to keep in sync across processes/machines if the user is allowed to edit any of the data at all. If its read only and N is small, it can work. If N is not small or you need to be able to update it, a JSON file is a bad idea.

  • Related