Planning Your Data Model

Before you begin implementing a MongoDB database, you need to understand the nature of the data that is being stored, how that data is going to get stored, and how it is going to be accessed. Understanding these concepts will allow you to make determinations ahead of time and structure the data and your application for optimal performance.

Specifically, you should answer the following questions:

Image What are the basic objects that the application will be using?

Image What is the relationship between the different object types: one-to-one, one-to-many, or many-to-many?

Image How often will new objects be added to the database?

Image How often will objects be deleted from the database?

Image How often will objects be changed?

Image How often will objects be accessed?

Image How will objects be accessed, by ID, property values, comparisons, etc.?

Image How will groups of object types be accessed: by common ID, common property value, etc.?

Once you have the answers to these questions, you are ready to consider the structure of collections and documents inside the MongoDB database. The following sections discuss different methods of document, collection, and database modeling you can utilize in MongoDB to optimize data storage and access.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.146.173