Topic

Document databases

A document database stores records as structured documents that can contain fields, nested values, and arrays.

At a glance

Record shape
Structured document
Design choice
Embedding or referencing related data

Overview

A document database stores records as structured documents that can contain fields, nested values, and arrays. Related information can be grouped within a document, giving applications an alternative to representing every relationship through separate relational tables.

Modeling related information

Embedding keeps related values together in one document. References connect separate documents. The appropriate choice depends on how data is read, updated, and shared across the application.

Flexible does not mean undefined

A flexible storage model still needs agreed data shapes. Validation and indexes help make queries and updates predictable, and schema evolution should consider older records as well as newly written ones.

Sources and review

MOOR's explanatory text is supported by the following source links.

  1. MongoDB manual — MongoDB
  2. Data modeling — MongoDB

Browse MOOR Knowledge