openskills.info
Course Preview

Document Databases

Document databases store data as semi-structured documents — typically JSON or BSON — rather than fixed rows and columns. They support flexible schemas, nested structures, and queries within documents, suiting workloads where data shapes vary or evolve frequently.

itDatabases and data storage

Document Databases

A document database stores each record as a document: a self-contained group of named fields and values. A document can contain strings, numbers, Boolean values, null values, nested objects, and arrays. Many products use JSON or a JSON-like format. MongoDB, for example, stores BSON documents, which extend the JSON model with additional data types.

The useful idea is not "JSON instead of tables." It is the aggregate: data that your application reads and changes together can live together. An order document can contain its delivery address and line items. One read can retrieve the order as a complete unit. One single-document write can change several fields atomically in systems that provide document-level atomicity.

That shape can reduce joins and let related fields evolve together. It also moves important design decisions into the document boundary. You still design a schema, even when the database does not require every document to have identical fields.

Why document databases exist

Relational databases organize data into tables and use relationships between rows. That model is strong when shared facts must stay normalized and queries combine data in many ways. It can be awkward when an application usually loads one nested object and must reconstruct it from several tables.

A document database makes the stored record resemble the object or message used by the application. This can help when:

  • one entity owns a bounded set of nested data;
  • records of the same broad type have optional or varying fields;
  • the application usually reads an entire aggregate by its identifier;
  • development requires controlled schema evolution;
  • data must distribute across partitions for horizontal scale.

These are tendencies, not guarantees. Products differ in query languages, index types, transaction scope, validation, replication, and consistency. Verify the behavior of the product and deployment you select.

The document mental model

Continue the course

This section is part of the paid course.

See pricing to subscribe, or log in if you already have access.

Where this skill leads

Relevant careers

See how this topic contributes to broader role-level skill maps.

Sources