---
title: Evaluation Criteria
slug: v4-4/Lz-6qIUtAhhgaLE77377l
docTags: 
createdAt: 2023-10-06T14:44:10.247Z
---

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.&#x20;

:::hint{type="info"}
The flat model is a simple, non‑embedded structure in which you spread your data across multiple separate documents. For more information, see [Relationships](docId\:LQGzvVHtqzybx_ALD5b8J) > [Good Pattern: Flat Models](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:&#x20;

- [Data Complexity](./#data-complexity)
- [Query Performance](./#query-performance)
- [Data Size](./#data-size)
- [Concurrency](./#concurrency)
- [Document Structure](./#document-structure)
- [Scalability](./#scalability)

# Data Complexity

The following table provides criteria for the levels of complexity in your data model:&#x20;

| **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:&#x20;

| **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`:

:::hint{type="warning"}
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 [Data Types](docId\:yxemKH1COm3CSUuMqcnlf) > [Attachment](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&#x20;*&#x6C;ikely 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:&#x20;

| **Criteria**                                                                                        | **Model** |
| --------------------------------------------------------------------------------------------------- | --------- |
| You anticipate that you'll add more data or expand relationships in the future.                     | Embedded  |
| You do *not&#x20;*&#x61;nticipate that you'll add more data or expand relationships in the future.  | Flat      |

