-2

Currently I have a static json file with a hierarchical data schema of below format.

{
    "Country1": {
        "State1": {
            "City1": {
                "City1ConfigurationOverides": {
                    "C1ConfigurationKey1": "C1ConfigurationValue13"
                }
            },
            "City2": {},
            "State1ConfigurationOverides": {
                "C1ConfigurationKey1": "C1ConfigurationValue12"
            }
        },
        "State2": {
            "C1State2City1": {},
            "State2ConfigurationOverides": {
                "C1ConfigurationKey1": "C1ConfigurationValue22"
            }
        },
        "Country1-Configurations": {
            "C1ConfigurationKey1": "C1ConfigurationValue1",
            "C1ConfigurationKey2": "C1ConfigurationValue2"
        }
    },
    "Country2": {
        "C2State1": {
            "C2S1City1": {},
            "C2S1City2": {}
        },
        "C2State2": {
            "C2State2AnotherCity": {}
        }
    }
}

If you notice the above json, we should have the flexibility to add different new keys at country/state/region level. We should also have the flexibility to add new keys under country configurations or overide those in underlying state/city. I would want to move this to a database with flexibility to add more keys dynamically in future at any level and query states/cities/configurations of a country with as minimal latency as possible. Kindly suggest what could be the best database for this use case and the schema.

New contributor
Vivek Krishna is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • 1
    Asking for tool recommendations is off-topic. Also the question is pretty vague and shows no effort in finding solutions. – Rik D Apr 7 at 7:31