Platform Manual
Document Model
Evaluation Criteria
the decision to use deeply embedded maps in a single document or opt for a flat model instead depends on your specific requirements, relationships between data, and tolerance for certain tradeoffs the flat model is a simple, non‑embedded structure in which you spread your data across multiple separate documents for more information, see docid\ lqgzvvhtqzybx ald5b8j > docid\ lqgzvvhtqzybx ald5b8j when assessing whether to embed maps in a document or distribute the data across multiple smaller documents, refer to the following criteria to guide you /#data complexity /#query performance /#data size /#concurrency /#document structure /#scalability data complexity the following table provides criteria for the levels of complexity in your data model criteria model you have a clear relationship between data items stored together in a collection embedded your data items are relatively simple and do not need a strong relationship flat query performance the following table provides criteria for the speed and efficiency of read and write operations criteria model you frequently retrieve or update the embedded map items together embedded you frequently access or modify only certain parts of the data flat data size the following table provides criteria for the potential size of the embedded map syncing large documents can significantly impact network performance caution is advised when handling large binary data, such as a high resolution image or video exceeding 50 megapixels; a deeply embedded document; or a very large document instead of storing files exceeding 250kb directly within a document object, carefully consider using attachments for more information, see docid\ yxemkh1com3csuumqcnlf > docid\ slqobcnxtyf keli7l8f8 criteria model you do not anticipate the embedded map to become too large and potentially impact overall system performance embedded you anticipate the embedded map to increase in complexity and size and therefore become difficult to manage and so large that system performance degrades flat concurrency the following table provides criteria for the potential for concurrent edits and resulting merge conflicts criteria model it is very likely that your end users will modify the same data items stored locally on their respective environments while internet is unavailable embedded it is not likely that your end users will modify the same data items stored locally on their respective environments while internet is unavailable flat document structure the following table provides a criteria for assessing the overall structure of your documents criteria model your embedded maps are relatively simple in structure and do not require maintainability over time embedded multiple embedded maps are becoming deeply nested; as in you have an embedded map representing three or more levels in a hierarchy, necessitating better organization flat scalability the following table provides criteria for assessing how your data model may evolve over time criteria model you anticipate that you'll add more data or expand relationships in the future embedded you do not anticipate that you'll add more data or expand relationships in the future flat