As part of the effective implementation of parse the multiple JSON's and aggregate the resultant JSON as final out.
Let suppose :
Json1 :
[
{
"id":"abc",
"name" : "json"
},
... having 10k json objects
]
Json2:
[
{
"id":"abc",
"language" : "java"
},
... having 10k json objects
]
Json3:
[
{
"id":"abc",
"subject" : "solving"
},
... having 10k json objects
]
from the 3 jsons, requirements is 1. Optimised ways the search for the attribute "id" in 3 jsons and if match the map those json objects to final json object .
Approach followed
I tried in the following way
Iterate over the first JSON array object and find the one attribute "id" and iterate over remaining JSON's and look the matching "id" and corresponding JSON object merging and forming final objects In this process, Taking O(n^3) time for search the find the matching records more ever n > 10k in my case
What will be the best approach to proceed