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", ...