Outlier pattern

Reference type:Cheat sheetFormat:Syntax + example + use case

Reference group: Schema patterns

What it does

Prevents rare huge records from making every document inefficient.

Syntax

Isolate exceptional large relationships

Use case

Viral posts or huge parent-child relationships.

Outlier pattern: practical example
{ _id: postId, regularFollowerCount: 1000, hasLargeFollowerSet: true }
💡 Explanation Prevents rare huge records from making every document inefficient. When to use it Viral posts or huge parent-child relationships.
Key Takeaways
  • Prevents rare huge records from making every document inefficient.
  • Typical use: Viral posts or huge parent-child relationships.