![]() ![]() One-To-One (1:1) The 1:1 relationship describes a relationship between two entities. We will start with a look at the One-To-One (1:1) relationship then moving on to the OneTo-Many (1:N) and finally the Many-To-Many (N:M). In this chapter we will explore the basic relationships from traditional relational databases and how they relate to the document model in MongoDB. Schema Basics Before exploring the more advanced schemas in this book it’s important to revisit schema basics. If you come up with other brilliant schema design patterns feel free to drop me an email at or send me a tweet to I hope you enjoy the book and find the information useful. That said, this is not the end all of schema design for MongoDB. We will cover basics of MongoDB schema design, how MongoDB works under the covers and look at a series of schema design patterns that aim to solve specific issues that you might run into while working on your application. This book is an attempt to distill that knowledge into actionable information you can use for your own applications. As the product has matured over time, some patterns of schema design have emerged. The concepts of embedding and linking documents combined with many years of working with relational models means there is a learning process involved in moving to a document database. Introduction One of the questions that comes up very often from new users of MongoDB and document databases is how to do schema design. ![]() Internationalization Schema Observations Schema Operations Indexes Scaling Performance Notes Time Series Schema Observations Schema Operations Indexes Scaling PerformanceĪrray Slice Cache Schema Observations Schema Operations Indexes Scaling Performance Notes Theater Reservation Schema Observations Schema Operations Indexes Scaling Performance NotesĪccount Transactions Schema Observations Schema Operations Indexes Scaling Performance Notes Shopping Cart with No Product Reservation Schema Observations Schema Operations Indexes Scaling Performance Notes Shopping Cart with Product Reservation Schema Observations Schema Operations Indexes Scaling Performance Notes Materialized Path Category Hierarchy Schema Observations Schema Operations Indexes Covered Index Queries Scaling Metadata Schema Observations Schema Operations Indexes Scaling Performance Notes Topics Schema Observations Schema Operations Indexes Scaling Performance Notes Queue Schema Observations Schema Operations Indexes Scaling Performance Notes Schema Design Read Ratio to Write Ratio Avoid Application Joins Pre-aggregate Data Avoid Growing Documents (MMAP) Avoid Updating Whole Documents (MMAP) Pre-allocated Documents (MMAP) Field Names Take up Space (MMAP) Over Eager Indexing Custom _id Field Covered Indexes Sharding Sharding Topology When to Shard Choosing a Shard Key Routing Shard Keys Inbox Example Multiple Identities Example Sharding Anti-Patterns Indexes Single field indexes Compound indexes Multi key indexes Geo-spatial indexes Text indexes Sparse indexes Unique indexes Time To Live indexes Covered Index Queries WiredTiger Storage Engine Overview of WiredTiger Essentials Tuning When to use WiredTiger MMAP Storage Engine Overview Memory Mapped Files Allocation Locking Many-To-Many (N:M) Two Way Embedding One Way Embedding Table of Contents Introduction Schema Basics One-To-One (1:1) Model ![]() Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do. Leanpub empowers authors and publishers with the Lean Publishing process. The Little Mongo DB Schema Design Book Christian Kvalheim This book is for sale at This version was published on The book aims to provide developers with a deep but concise understanding of how to efficiently work with MongoDB. A Theater Ticket Reservation Schema Pattern.Shopping Cart Schema Pattern with and without product reservation.Understanding the MongoDB MMAP and WiredTiger storage engine.Schema Basics including one to one, one to many and many to many relationships.We cover a lot of different aspects of Schema Design in this book. It tries to cover essential information that you can apply to your own applications. This book came around, due to my experiences teaching people about using MongoDB for application development. I wrote this book to be a helpful and concise guide to MongoDB Schema design, as well as a repository to look up specific MongoDB Schema patterns. The Little MongoDB Schema Design Book, covers the fundamentals off Schema design with MongoDB, as well as several useful Schema design patters for your applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |