LAB S002: Computed Design Pattern (GSI) (Application Delivery)

Learn to speed development by leveraging or avoiding commonly-used foundational design patterns. In this lab, you will focus on the computed (fan-out) pattern pattern and how it executes upon a given document.

The MongoDB document model proves a powerful tool for developers. Relational databases require thinking in rows and columns (rectangular schema), but developers build with objects. Translationing between rectangular schema and in-memory objects within a programming language takes a non-trivial amount of work, even with Object Relational Mappers (ORM).

MongoDB offers a different approach. A fundamental concept of MongoDB-based development is to store data as it's used. We call this use case first development. Developers work in objects, and MongoDB allows storing objects directly. Objects are stored using the document model, where documents represent objects stored in the database. Documents have rich data types, just like in the languages that originate the objects.

We at MongoDB have developed a series of patterns often found in MongoDB schema. These patterns are foundational. Developers may leverage them to speed their development. Unlike rectangular schema, MongoDB patterns are based on everyday use cases and are optimized for fast storage and retrieval. This differs from a rectangular schema, which efficiently stores data for gathering across multiple tables.

In this lab, you will be exploring the computed (fan-out) pattern and how it executes upon a given document.