Choose the Correct Data Model for MongoDB Application

45 minutes
  • 3 Learning Objectives

About this Hands-on Lab

In this lab, students will be provided with sample data and an application description. Their task will be to import this data into a new MongoDB collection, using the most appropriate data model for the given application description. After completing this lab, students will have gained hands-on experience designing data models and importing data.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Load Data Files into a New Collection

Load the provided sample data files (inventory.csv and checkout.csv) into a new collection in a MongoDB database.

Normalize Publisher Information

Extract the publisher contact information from the inventory collection to a new collection with a name of your choosing, and remove the publisher contact information from the inventory collection.

Denormalize the Checkout Information

Embed the checkout information in the same collection as the book inventory information.

Additional Resources

You are designing an application for the local library to track their book collection. You have been provided with a sample of the data from the current database. After the application design is approved, a plan to migrate all the data will be made. You will need to import this data into an appropriate data model in a new MongoDB collection.

The current database has proved problematic in a couple of areas. The availability of the books always seemed to be out of sync with the actual count. This resulted in disappointed patrons when the expected book was not available. Additionally, the existing database consumed more storage than expected. Any ways to reduce the amount of storage used would be greatly appreciated.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?