liveBook · Manning

Document

As explained in Building Web APIs with ASP.NET Core

A database document is a self-contained record represented as structured fields, commonly including nested related information.

A database document is a flexible collection of key/value fields that represents a record together with related information. Documents are stored in NoSQL collections rather than fixed-schema SQL tables. section 4.1.1

Documents shape relationships and schema design in several practical ways:

  • Embed parent-child data—such as comments inside a board-game document—to reduce the need for separate collections. section 4.1.1
  • Keep shared entities, such as users, addressable through key-based relationships when multiple documents need to reference them. section 4.1.1
  • Favor loosely structured and denormalized schemas, trading fixed organization for flexible records that often contain related data. section 4.1.1

Board-game data

A board-game document can contain the game’s fields and its related comments, while a user remains separately referenceable when used across documents. section 4.1.1

Figure 4.2 MyBGList database schema diagram for a document-oriented NoSQL database
04-02

Compare the document-oriented database schema with the table-oriented alternative. section 4.1.1

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Defines document structure and relationship handling, but stops short of implementation syntax or database-specific operations.
Examples
Uses users, roles, board games, and comments to illustrate embedded and separately referenced information.
What it assumes
Contrasts flexible documents with basic SQL tables, rows, columns, and primary-key relationships.
What you can do after
Evaluate whether related data should be embedded or referenced in a flexible NoSQL schema.
How it connects
Connects documents with NoSQL databases, collections, embedded relationships, key-based references, and denormalized schemas.

Also explained in

Compare how 8 books explain Document →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.