Data model considerations
When it comes to the data model design choice, we always struggle to choose between a hierarchical (collection group) format and a format closer to a denormalized form (top-level collection) of storing data. Before we get into that, let’s talk about the hierarchical and denormalized formats!
Hierarchical format
The hierarchical format represents information in a structured, nested format. This format is ideal for scenarios where data has clear parent–child relationships or when you want to maintain a well-defined structure. The following is an example of hierarchical data using JSON to represent an organizational hierarchy:
{ Â Â "organization": { Â Â Â Â "name": "XYZ Corporation", Â Â Â Â "departments": [ Â Â Â Â Â Â { Â Â Â Â Â Â Â Â "name": "HR", Â Â Â Â Â ...