0 Question: JSON : To Recreate or Update?

question created at Sat, Jun 1, 2019 12:00 AM

I am a functional analyst that is trying to validate something my developer is telling me. We currently have a 50 GB JSON file that has roughly 200,000 records. This file will regularly need to have 10 records added and another 10 updated. We are trying to figure out the fastest way to rebuild this file.

(Yes, I know a database is an option, but this is a unique case where JSON is needed.)

An example of our code is shown below:

{
"markers": [     
{
"name": "Rixos The Palm Dubai",       
"position": [25.1212, 55.1535],     
},     
{       
"name": "Shangri-La Hotel",       
"location": [25.2084, 55.2719]     
},     
{       
"name": "Grand Hyatt",       
"location": [25.2285, 55.3273]     
}
] 
} 

If I need to update the Grand Hyatt location and create "Wyndam Hotel" on an existing JSON file, is it faster/more efficient to completely delete and rebuild the file or just update it with the changes?

I am wondering if anyone else has run into this. Any thoughts on which method would be faster would be greatly appreciated.

0
  1. One word: database.
    2019-06-01 04:45:07Z
  2. That is definitely one answer, but we are being forced to use JSON for this. It's kind of a unique situation. Thanks!
    2019-06-01 04:58:31Z
  3. Can you tell us more about the file and the required updates? JSON does not have a specific definition of “row”, so some clarification of the task would be helpful.
    2019-06-01 09:25:03Z
  4. I have updated the post with additional information, including changing the word "rows" to "records.". My apologies for the error, and thanks for your response!
    2019-06-01 12:27:36Z
0 Answers 0
source placed here