content_image/816858.jpg
<img src='content_image/816858.jpg'>

## Embedded Data 

Embedded documents capture relationships between data by storing related data in a single document structure. Mon- goDB documents make it possible to embed document structures in a field or array within a document. These denor- malized data models allow applications to retrieve and manipulate related data in a single database operation. 

See Embedded Data Models (page 146) for the strengths and weaknesses of embedding documents. 

## 4.1.2 Atomicity of Write Operations 

In MongoDB, write operations are atomic at the document level, and no single write operation can atomically affect more than one document or more than one collection. A denormalized data model with embedded data combines all related data for a represented entity in a single document. This facilitates atomic write operations since a single write operation can insert or update the data for an entity. Normalizing the data would split the data across multiple collections and would require multiple write operations that are not atomic collectively. 

However, schemas that facilitate atomic writes may limit ways that applications can use the data or may limit ways to modify applications. The Atomicity Considerations (page 148) documentation describes the challenge of designing a schema that balances flexibility and atomicity. 

## 4.1.3 Document Growth 

Some updates, such as pushing elements to an array or adding new fields, increase a document’s size. 

For the MMAPv1 storage engine, if the document size exceeds the allocated space for that document, MongoDB relocates the document on disk. When using the MMAPv1 storage engine, growth consideration can affect the decision to normalize or denormalize data. See Document Growth Considerations (page 148) for more about planning for and managing document growth for MMAPv1. 

