MongoDB Fundamentals
eBook - ePub

MongoDB Fundamentals

A hands-on guide to using MongoDB and Atlas in the real world

Amit Phaltankar, Juned Ahsan, Michael Harrison, Liviu Nedov

  1. 748 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

MongoDB Fundamentals

A hands-on guide to using MongoDB and Atlas in the real world

Amit Phaltankar, Juned Ahsan, Michael Harrison, Liviu Nedov

Book details
Book preview
Table of contents
Citations

About This Book

Learn how to deploy and monitor databases in the cloud, manipulate documents, visualize data, and build applications running on MongoDB using Node.js

Key Features

  • Learn the fundamentals of NoSQL databases with MongoDB
  • Create, manage, and optimize a MongoDB database in the cloud using Atlas
  • Use a real-world dataset to gain practical experience of handling big data

Book Description

MongoDB is one of the most popular database technologies for handling large collections of data. This book will help MongoDB beginners develop the knowledge and skills to create databases and process data efficiently.

Unlike other MongoDB books, MongoDB Fundamentals dives into cloud computing from the very start – showing you how to get started with Atlas in the first chapter. You will discover how to modify existing data, add new data into a database, and handle complex queries by creating aggregation pipelines. As you progress, you'll learn about the MongoDB replication architecture and configure a simple cluster. Youwill also get to grips with user authentication, as well as techniques for backing up and restoring data. Finally, you'll perform data visualization using MongoDBCharts.

You will work on realistic projects that are presented as bitesize exercises and activities, allowing you to challenge yourself in an enjoyable and attainable way. Manyof these mini-projects are based around a movie database case study, while the last chapter acts as a final project where you will use MongoDB to solve a real-world problem based on a bike-sharing app.

By the end of this book, you'll have the skills and confidence to process large volumes of data and tackle your own projects using MongoDB.

What you will learn

  • Set up and use MongoDB Atlas on the cloud
  • Insert, update, delete, and retrieve data from MongoDB
  • Build aggregation pipelines to perform complex queries
  • Optimize queries using indexes
  • Monitor databases and manage user authorization
  • Improve scalability and performance with sharding clusters
  • Replicate clusters, back up your database, and restore data
  • Create data-driven charts and reports from real-time data

Who this book is for

This book is designed for people who are new to MongoDB. It is suitable for developers, database administrators, system administrators, and cloud architects who are looking to use MongoDB for smooth data processing in the cloud. Although not necessary, basic knowledge of a general programming language and experience with other databases will help you grasp the topics covered more easily.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is MongoDB Fundamentals an online PDF/ePUB?
Yes, you can access MongoDB Fundamentals by Amit Phaltankar, Juned Ahsan, Michael Harrison, Liviu Nedov in PDF and/or ePUB format, as well as other popular books in Informatica & Database. We have over one million books available in our catalogue for you to explore.

Information

Year
2020
ISBN
9781839213045
Edition
1
Subtopic
Database

1. Introduction to MongoDB

Overview
This chapter will introduce you to MongoDB fundamentals, first defining data and its types, then exploring how a database solves data storage challenges. You will learn about the different types of databases and how to select the right one for your task. Once you have a clear idea about these concepts, we will discuss MongoDB, its features, architecture, licensing, and deployment models. By the end of the chapter, you will have gained hands-on experience using MongoDB through Atlas—the cloud-based service used to manage MongoDB—and worked with its basic elements, such as databases, collections, and documents.

Introduction

A database is a platform to store data in a way that is secure, reliable, and easily available. There are two types of databases used in general: relational databases and non-relational databases. Non-relational databases are often called as NoSQL databases. A NoSQL database is used to store large quantities of complex and diverse data, such as product catalogs, logs, user interactions, analytics, and more. MongoDB is one of the most established NoSQL databases, with features such as data aggregation, ACID (Atomicity, Consistency, Isolation, Durability) transactions, horizontal scaling, and Charts, all of which we will explore in detail in the upcoming sections.
Data is crucial for businesses—specifically, storing, analyzing, and visualizing the data while making data-driven decisions. It is for this reason that MongoDB is trusted and used by companies such as Google, Facebook, Adobe, Cisco, eBay, SAP, EA, and many more.
MongoDB comes in different variants and can be utilized for both experimental and real-world applications. It is easier to set up and simpler to manage than most other databases due to its intuitive syntax for queries and commands. MongoDB is available for anyone to install on their own machine(s) or to be used on the cloud as a managed service. MongoDB's cloud-managed service (called Atlas) is available to everyone for free, whether you are an established enterprise or a student. Before we start our discussion of MongoDB, let us first learn about database management systems.

Database Management Systems

A Database Management System (DBMS) provides the ability to store and retrieve data. It uses query languages to create, update, delete, and retrieve data. Let us look at the different types of DBMS.

Relational Database Management Systems

Relational Database Management Systems (RDBMS) are used to store structured data. The data is stored in the form of tables that consist of rows and columns. The tables can have relationships with other tables to depict the actual data relationships. For example, in a university relational database, the Student table can be related to the Course and Marks Obtained tables through a common columns such as courseId.

NoSQL Database Management Systems

NoSQL databases were invented to solve the problem of storing unstructured and semi-structured data. Relational databases enforce the structure of data to be defined before the data can be stored. This database structure definition is often referred to as schema, which pertains to the data entities, that is, its attributes and types. RDBMS client applications are tightly coupled with the schema. It is hard to modify the schema without affecting the clients. Contrastingly, NoSQL databases allow you to store the data without a schema and also support dynamic schema, which decouples the clients from a rigid schema, and is often necessary for modern and experimental applications.
The data stored in the NoSQL database varies depending on the provider, but generally, data is stored as documents instead of tables. An example of this would be databases for inventory management, where different products can have different attributes and, therefore, require a flexible structure. Similarly, an analytics database that stores data from different sources in different structures would also need a flexible structure.

Comparison

Let us compare NoSQL databases and RDBMS based on the following factors. You will get an in-depth understanding of these as you read through this book. For now, a basic overview is provided in the following table:
Figure 1.1: Differences between relational databases and NoSQL
Figure 1.1: Differences between relational databases and NoSQL
That concludes our discussion on databases and the differences between the various database types. In the next section, we will begin our exploration of MongoDB.

Introduction to MongoDB

MongoDB is a popular NoSQL database that can store both structured and unstructured data. Founded in 2007 by Kevin P. Ryan, Dwight Merriman, and Eliot Horowitz in New York, the organization was initially called 10gen and was later renamed MongoDB—a word inspired by the term humongous.
It provides both essential and extravagant features that are needed to store real-world big data. Its document-based design makes it easy to understand and use. It is built to be utilized for both experimental and real-world applications and is easier to set up and simpler to manage than most of the other NoSQL databases. Its intuitive syntax for queries and commands makes it easy to learn.
The following list explores these features in detail:
  • Flexible and Dynamic Schema: MongoDB allows a flexible schema for your database. A flexible schema allows variance in fields in different documents. In simple terms, each record in the database may or may not have the same number of attributes. It addresses the need for storing evolving data without making any changes to the schema itself.
  • Rich Query Lang...

Table of contents

  1. MongoDB Fundamentals
  2. Preface
  3. 1. Introduction to MongoDB
  4. 2. Documents and Data Types
  5. 3. Servers and Clients
  6. 4. Querying Documents
  7. 5. Inserting, Updating, and Deleting Documents
  8. 6. Updating with Aggregation Pipelines and Arrays
  9. 7. Data Aggregation
  10. 8. Coding JavaScript in MongoDB
  11. 9. Performance
  12. 10. Replication
  13. 11. Backup and Restore in MongoDB
  14. 12. Data Visualization
  15. 13. MongoDB Case Study
  16. Appendix
Citation styles for MongoDB Fundamentals

APA 6 Citation

Phaltankar, A., Ahsan, J., Harrison, M., & Nedov, L. (2020). MongoDB Fundamentals (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/2059687/mongodb-fundamentals-a-handson-guide-to-using-mongodb-and-atlas-in-the-real-world-pdf (Original work published 2020)

Chicago Citation

Phaltankar, Amit, Juned Ahsan, Michael Harrison, and Liviu Nedov. (2020) 2020. MongoDB Fundamentals. 1st ed. Packt Publishing. https://www.perlego.com/book/2059687/mongodb-fundamentals-a-handson-guide-to-using-mongodb-and-atlas-in-the-real-world-pdf.

Harvard Citation

Phaltankar, A. et al. (2020) MongoDB Fundamentals. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/2059687/mongodb-fundamentals-a-handson-guide-to-using-mongodb-and-atlas-in-the-real-world-pdf (Accessed: 15 October 2022).

MLA 7 Citation

Phaltankar, Amit et al. MongoDB Fundamentals. 1st ed. Packt Publishing, 2020. Web. 15 Oct. 2022.