The data in MongoDB has a flexible pattern. Documents in the same set are not required to have a collection of common fields of the same set of fields or structures, and the document can accommodate different types of data.
Some considerations for MongoDB design Patterns
The architecture can be designed according to user requirements.
Merges the object into a file if you want to put them together. Otherwise separate them (but make sure you don't need to connect).
Duplicate data (limited) because disk space is cheap (compared to compute time).
You do not need a connection to write, but read.
Optimizing the schema is the most common use case.
Do complex aggregation on the pattern.
Example
Suppose a client needs a database design, design a blog site, and look at the differences between RDBMS and MongoDB architecture design. The website has the following requirements.
Each article content has a unique title, description and URL.
Each article content can have one or more tags.
Each article content has its own number of publishers like the name.
Each article content has comments as well as names, messages, time and favorite users.
For each article, it can be 0 or more comments.
The above requirements are designed in RDBMS mode and there will be at least three tables.
The MongoDB pattern design is a collection of articles and has the following structure:
{ _id:post_id title:title_of_post, description:post_description, by:post_by, url:url_ Of_post, Tags: [TAG1, TAG2, TAG3], likes:total_likes, comments: [ { User:' comment_by ' , Message:text, datecreated:date_time, like:likes }, { User:' Comment_ By ', message:text, datecreated:date_time, like:likes } ]}
Therefore, although the RDBMS wants to display data, it needs to add three tables, while the MongoDB data is only from a collection.
MongoDB (quad) MongoDB data Model