A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mongodb.com/docs/manual/data-modeling/schema-design-process/apply-patterns/ below:

Apply Design Patterns - Database Manual

Schema design patterns are ways to optimize your data model for your application's access patterns. They improve application performance and reduce schema complexity. Schema design patterns affect how your data is stored and what data is returned to your application.

For a list of schema design patterns and examples, see the Building with Patterns MongoDB blog series.

Before you implement schema design patterns, consider the problem that you are trying to solve. Each schema design pattern has different use cases and tradeoffs for data consistency, performance, and complexity. For example, some schema design patterns improve write performance, while others improve read performance.

Implementing a pattern without understanding your application and the data it needs can degrade application performance and cause unnecessary complications to your schema design.

Consider the following example patterns used by a movie theater franchise:

db.movie.insertOne(  {    _id: 1,    title: "Titanic",    year: 1997,    director: "James Cameron",    runtime: 194,    distributor: "Paramount Pictures",    languages: [ "English" ],    total_views: 3500  })
db.theater.insertMany(  [    {      name: "Downtown Cinemas",      address: {        street: "2212 Taylor Street",        state: "NY"      },      movies: [        {           movie_id: 1,           title: "Titanic",           runtime: 194,           views: 1500        }      ]    },    {      name: "Midtown Theater",      address: {        street: "1232 5th Street",        state: "NY"      },      movies: [        {           movie_id: 1,           title: "Titanic",           runtime: 194,           views: 2000        }      ]    }  ])

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4