
Mastering MongoDB 7.0
Description
Book Introduction
MongoDB technologies needed to build efficient, secure, and high-performance applications
This is the ultimate guide that covers everything from using MongoDB to its advanced features.
We begin with MongoDB architecture, developer tools, and database connectivity, then explore advanced queries, including aggregation pipelines and multi-document ACID transactions, and introduce cutting-edge features useful for AI applications, such as Atlas vector search.
This is the first official book written by MongoDB contributors, covering advanced technologies such as Atlas search, RBAC, auditing, and encryption in depth.
The translator, a MongoDB expert, added the contents of version 8.0 as an appendix to the Korean version.
This is the ultimate guide that covers everything from using MongoDB to its advanced features.
We begin with MongoDB architecture, developer tools, and database connectivity, then explore advanced queries, including aggregation pipelines and multi-document ACID transactions, and introduce cutting-edge features useful for AI applications, such as Atlas vector search.
This is the first official book written by MongoDB contributors, covering advanced technologies such as Atlas search, RBAC, auditing, and encryption in depth.
The translator, a MongoDB expert, added the contents of version 8.0 as an appendix to the Korean version.
- You can preview some of the book's contents.
Preview
index
About the Author and Translator xiv
Introduction to the Technical Reviewer xvii
Translator's Preface xix
Recommendation xxi
Beta Reader Review xxiv
Author's Note xxvii
About this book xxix
CHAPTER 1 Introduction to MongoDB 1
1.1 Who Uses MongoDB? 1
1.2 Why Developers Prefer MongoDB 2
1.3 Efficiency of the Inherent Complexity of the MongoDB Database 4
1.4 Summary 6
CHAPTER 2 MongoDB Architecture 7
2.1 Replication and Sharding 8
2.2 Replication 8
2.3 Sharding 17
2.4 New Sharding Cluster Features in MongoDB 7.0 32
2.5 Summary 33
CHAPTER 3 DEVELOPER TOOLS 35
3.1 Technical Requirements 36
3.2 Introduction to Development Tools 36
3.3 MongoDB Shell 38
3.4 MongoDB CLI 44
3.5 MongoDB Compass 48
3.6 MongoDB for VS Code 53
3.7 Summary 55
CHAPTER 4 Connecting to MongoDB 57
4.1 Connection Method 57
4.2 Summary 72
CHAPTER 5 CRUD Operations and Basic Queries 74
5.1 Technical Requirements 74
5.2 Basic MongoDB Data Operations 75
5.3 CRUD Processing Using Ruby Driver 85
5.4 CRUD Processing Using the Python Driver 94
5.5 Regular Expressions 102
5.6 Management Functions 104
5.7 Secure Access to MongoDB 107
5.8 MongoDB Stable API 110
5.9 Summary 112
CHAPTER 6 Schema Design and Data Modeling 113
6.1 Schema Design for Relational Databases 114
6.2 Schema Design for MongoDB 116
6.3 Data Modeling in MongoDB 117
6.4 MongoDB Database Modeling: Design Principles and Recommended Practices 122
6.5 Design Patterns and Schema Design 122
6.6 Summary 129
CHAPTER 7 Advanced MongoDB Queries 130
7.1 Introduction to the Aggregation Framework 130
7.2 Benefits of MongoDB Aggregations 132
7.3 Aggregation Stage 133
7.4 Query Techniques 147
7.5 Indexes and Query Optimization 164
7.6 MongoDB Location-Based Data Processing 169
7.7 Summary 172
CHAPTER 8 Tally 173
8.1 Technical Requirements 174
8.2 MongoDB Aggregation Framework 174
8.3 Basic Aggregation Operators 179
8.4 Best Practices 192
8.5 Summary 194
CHAPTER 9 Multi-Document ACID Transactions 195
9.1 Why are transactions useful? 196
9.2 ACID Properties 196
9.3 MongoDB Implementation of ACID 199
9.4 Best Practices 212
9.5 Summary 213
CHAPTER 10: INDEX OPTIMIZATION 214
10.1 Introduction to Index 215
10.2 Index Types 220
10.3 Index Optimization Best Practices 240
10.4 Summary 240
CHAPTER 11 MongoDB Atlas 242
11.1 MongoDB Atlas as a Database Service 243
11.2 Atlas Developer Data Platform 255
11.3 Atlas Vector Search and Its Role in AI Applications 255
11.4 Atlas Application Services 259
11.5 Atlas Data API 262
11.6 Atlas Data Lake 265
11.7 Atlas Data Federation 266
11.8 Atlas Stream Processing 269
11.9 Atlas SQL Interface 272
11.10 MongoDB Atlas Chart 274
11.11 Operational Integration: Atlas Kubernetes Operator 277
11.12 Atlas CLI 280
11.13 Summary 282
CHAPTER 12 MongoDB Monitoring and Backup 283
12.1 MongoDB Monitoring 283
12.2 What Should I Monitor? 285
12.3 Monitoring WiredTiger Memory Usage 291
12.4 Page Fault Tracing 291
12.5 Working Set Calculation 293
12.6 MongoDB Reporting Tools Overview 294
12.7 Hosting Monitoring Tools Overview 295
12.8 How to Backup MongoDB 297
12.9 Common Mistakes and Pitfalls in MongoDB Monitoring and Backups 302
12.10 Summary 304
CHAPTER 13 Atlas Search 305
13.1 MongoDB Atlas Search 306
13.2 The Technical Structure and Operation of the Atlas Search Index 309
13.3 Apache Lucene 328
13.4 Summary 331
CHAPTER 14 Integrating Applications with MongoDB 333
14.1 Technical Requirements 333
14.2 Integrating Applications with MongoDB 334
14.3 MongoDB Kubernetes Operator 336
14.4 Integrating Terraform and MongoDB 340
14.5 Using Versell with MongoDB 344
14.6 Integrating Datadog and MongoDB 348
14.7 Integrating Prometheus and MongoDB 353
14.8 Integrating Webhooks with MongoDB 357
14.9 Phaser Duty Integrated 361
14.10 Summary 365
CHAPTER 15 Security 367
15.1 Authentication Method 368
15.2 Role-Based Access Control (RBAC) 385
15.3 Summary 396
CHAPTER 16 Gratitude 397
16.1 MongoDB Auditing and Logging 398
16.2 Auditable Event Types 401
16.3 Enabling Auditing in MongoDB 402
16.4 Case Study: The Role of Auditing in Compliance 410
16.5 Troubleshooting Auditing Issues in MongoDB 411
16.6 Summary 413
CHAPTER 17: Encryption 414
17.1 Encryption Types 415
17.2 Encryption in Transit 416
17.3 Encryption at Rest 421
17.4 Client-Side Encryption 426
17.5 Summary 432
APPENDIX A New Features and Improvements in MongoDB 8.0 433
A.1 Supported Platforms and Operating Systems 433
A.2 Enhanced Monitoring and Performance Analysis Capabilities 433
A.3 Enhanced Security Features 434
A.4 Enhanced Flexibility of Sharding Functions 434
A.5 Replication Performance Improvements 435
A.6 System Management Function Improvements 435
A.7 Performance Optimization 436
A.8 Precautions when upgrading 437
APPENDIX B MongoDB 8.0 Compatibility Guide and Major Changes 438
B.1 New Changes in Query Behavior 438
B.2 Deprecated Features 439
B.3 Major changes for performance improvements 439
B.4 Additional Improvements 440
B.5 Finish 440
Search 441
Introduction to the Technical Reviewer xvii
Translator's Preface xix
Recommendation xxi
Beta Reader Review xxiv
Author's Note xxvii
About this book xxix
CHAPTER 1 Introduction to MongoDB 1
1.1 Who Uses MongoDB? 1
1.2 Why Developers Prefer MongoDB 2
1.3 Efficiency of the Inherent Complexity of the MongoDB Database 4
1.4 Summary 6
CHAPTER 2 MongoDB Architecture 7
2.1 Replication and Sharding 8
2.2 Replication 8
2.3 Sharding 17
2.4 New Sharding Cluster Features in MongoDB 7.0 32
2.5 Summary 33
CHAPTER 3 DEVELOPER TOOLS 35
3.1 Technical Requirements 36
3.2 Introduction to Development Tools 36
3.3 MongoDB Shell 38
3.4 MongoDB CLI 44
3.5 MongoDB Compass 48
3.6 MongoDB for VS Code 53
3.7 Summary 55
CHAPTER 4 Connecting to MongoDB 57
4.1 Connection Method 57
4.2 Summary 72
CHAPTER 5 CRUD Operations and Basic Queries 74
5.1 Technical Requirements 74
5.2 Basic MongoDB Data Operations 75
5.3 CRUD Processing Using Ruby Driver 85
5.4 CRUD Processing Using the Python Driver 94
5.5 Regular Expressions 102
5.6 Management Functions 104
5.7 Secure Access to MongoDB 107
5.8 MongoDB Stable API 110
5.9 Summary 112
CHAPTER 6 Schema Design and Data Modeling 113
6.1 Schema Design for Relational Databases 114
6.2 Schema Design for MongoDB 116
6.3 Data Modeling in MongoDB 117
6.4 MongoDB Database Modeling: Design Principles and Recommended Practices 122
6.5 Design Patterns and Schema Design 122
6.6 Summary 129
CHAPTER 7 Advanced MongoDB Queries 130
7.1 Introduction to the Aggregation Framework 130
7.2 Benefits of MongoDB Aggregations 132
7.3 Aggregation Stage 133
7.4 Query Techniques 147
7.5 Indexes and Query Optimization 164
7.6 MongoDB Location-Based Data Processing 169
7.7 Summary 172
CHAPTER 8 Tally 173
8.1 Technical Requirements 174
8.2 MongoDB Aggregation Framework 174
8.3 Basic Aggregation Operators 179
8.4 Best Practices 192
8.5 Summary 194
CHAPTER 9 Multi-Document ACID Transactions 195
9.1 Why are transactions useful? 196
9.2 ACID Properties 196
9.3 MongoDB Implementation of ACID 199
9.4 Best Practices 212
9.5 Summary 213
CHAPTER 10: INDEX OPTIMIZATION 214
10.1 Introduction to Index 215
10.2 Index Types 220
10.3 Index Optimization Best Practices 240
10.4 Summary 240
CHAPTER 11 MongoDB Atlas 242
11.1 MongoDB Atlas as a Database Service 243
11.2 Atlas Developer Data Platform 255
11.3 Atlas Vector Search and Its Role in AI Applications 255
11.4 Atlas Application Services 259
11.5 Atlas Data API 262
11.6 Atlas Data Lake 265
11.7 Atlas Data Federation 266
11.8 Atlas Stream Processing 269
11.9 Atlas SQL Interface 272
11.10 MongoDB Atlas Chart 274
11.11 Operational Integration: Atlas Kubernetes Operator 277
11.12 Atlas CLI 280
11.13 Summary 282
CHAPTER 12 MongoDB Monitoring and Backup 283
12.1 MongoDB Monitoring 283
12.2 What Should I Monitor? 285
12.3 Monitoring WiredTiger Memory Usage 291
12.4 Page Fault Tracing 291
12.5 Working Set Calculation 293
12.6 MongoDB Reporting Tools Overview 294
12.7 Hosting Monitoring Tools Overview 295
12.8 How to Backup MongoDB 297
12.9 Common Mistakes and Pitfalls in MongoDB Monitoring and Backups 302
12.10 Summary 304
CHAPTER 13 Atlas Search 305
13.1 MongoDB Atlas Search 306
13.2 The Technical Structure and Operation of the Atlas Search Index 309
13.3 Apache Lucene 328
13.4 Summary 331
CHAPTER 14 Integrating Applications with MongoDB 333
14.1 Technical Requirements 333
14.2 Integrating Applications with MongoDB 334
14.3 MongoDB Kubernetes Operator 336
14.4 Integrating Terraform and MongoDB 340
14.5 Using Versell with MongoDB 344
14.6 Integrating Datadog and MongoDB 348
14.7 Integrating Prometheus and MongoDB 353
14.8 Integrating Webhooks with MongoDB 357
14.9 Phaser Duty Integrated 361
14.10 Summary 365
CHAPTER 15 Security 367
15.1 Authentication Method 368
15.2 Role-Based Access Control (RBAC) 385
15.3 Summary 396
CHAPTER 16 Gratitude 397
16.1 MongoDB Auditing and Logging 398
16.2 Auditable Event Types 401
16.3 Enabling Auditing in MongoDB 402
16.4 Case Study: The Role of Auditing in Compliance 410
16.5 Troubleshooting Auditing Issues in MongoDB 411
16.6 Summary 413
CHAPTER 17: Encryption 414
17.1 Encryption Types 415
17.2 Encryption in Transit 416
17.3 Encryption at Rest 421
17.4 Client-Side Encryption 426
17.5 Summary 432
APPENDIX A New Features and Improvements in MongoDB 8.0 433
A.1 Supported Platforms and Operating Systems 433
A.2 Enhanced Monitoring and Performance Analysis Capabilities 433
A.3 Enhanced Security Features 434
A.4 Enhanced Flexibility of Sharding Functions 434
A.5 Replication Performance Improvements 435
A.6 System Management Function Improvements 435
A.7 Performance Optimization 436
A.8 Precautions when upgrading 437
APPENDIX B MongoDB 8.0 Compatibility Guide and Major Changes 438
B.1 New Changes in Query Behavior 438
B.2 Deprecated Features 439
B.3 Major changes for performance improvements 439
B.4 Additional Improvements 440
B.5 Finish 440
Search 441
Detailed image

Into the book
Just 10 years ago, MongoDB was a niche product.
It was a young database that was attractive only to leading developers.
But today, MongoDB is used across a wide variety of industries, with use cases spanning all sorts of situations and types of data stored.
The world's largest banks, automakers, government agencies, and gaming companies use MongoDB in their production applications.
Some of the most notable companies using MongoDB include Coinbase, Epic Games, Morgan Stanley, Adobe, Tesla, Canva, Ulta Beauty, Cathay Pacific, Dongwha, and Vodafone.
--- p.1
Mongoid is a leading ODM for MongoDB, allowing developers to intuitively and efficiently handle MongoDB databases in the Ruby on Rails framework.
While low-level drivers offer great flexibility, Mongoid provides high-level abstractions that integrate well with Rails' naming conventions, improving developer productivity.
This seamless integration simplifies tasks like schema definition, query writing, and data modeling, allowing developers to focus on application logic rather than database implementation. Like an ORM, an ODM minimizes the gap between the model and the database.
--- pp.91-92
One of MongoDB's most notable features is its flexible document structure.
It supports BSON documents and arrays with nesting up to 100 levels, which provides practical benefits beyond just technical features.
This deep structure not only maximizes the flexibility of the database, but also allows you to organize data in a way that is optimized for your application's needs.
In particular, these structural features provide three key advantages:
First, it greatly reduces the need for complex join operations.
It also makes the data retrieval process efficient and finally simplifies query writing.
--- p.117
The $gt(greater than) operator is used to search for data that exceeds a specified value.
For example, it is effective for tasks such as finding products above a certain price or viewing transaction details after a reference date.
On the other hand, the $lt (less than) operator is used to find data that is less than a specified value.
This is useful in situations such as identifying products whose inventory quantity is below a certain threshold or retrieving records from a specific period of time.
--- p.153
A key feature of composite indexes is the support for a variety of queries that utilize prefixes on the index fields.
For example, the composite index in the example above supports queries that combine author and ISBN code, as well as queries that use only the author field, which is the first field in the index.
On the other hand, queries performed on ISBN codes alone cannot utilize the index and result in a full collection scan.
(…) Composite indexes store document references in the order of their defined fields.
Figure 10.4 is an example showing this structure.
First, you can see that the sorting is done in ascending order (alphabetical order) based on the userid, and then the scores are sorted in descending order within each userid.
--- p.222
Vector search is a technique for searching based on the meaning of data.
This technology uses a machine learning model called an encoder to convert various data such as text, audio, and images into high-dimensional vectors.
The vectors generated in this way contain the semantic characteristics of the data, so we can find vectors that are close to each other in a high-dimensional space and identify similar content.
These vector searches can effectively complement traditional keyword-based searches.
In particular, it has recently attracted significant attention because it can provide additional information that goes beyond the limitations of large language models (LLMs).
In real-world search, it has the advantage of being able to find relevant results even when the exact search term is unknown, and its usefulness has been proven in various fields such as natural language processing and recommendation systems.
It was a young database that was attractive only to leading developers.
But today, MongoDB is used across a wide variety of industries, with use cases spanning all sorts of situations and types of data stored.
The world's largest banks, automakers, government agencies, and gaming companies use MongoDB in their production applications.
Some of the most notable companies using MongoDB include Coinbase, Epic Games, Morgan Stanley, Adobe, Tesla, Canva, Ulta Beauty, Cathay Pacific, Dongwha, and Vodafone.
--- p.1
Mongoid is a leading ODM for MongoDB, allowing developers to intuitively and efficiently handle MongoDB databases in the Ruby on Rails framework.
While low-level drivers offer great flexibility, Mongoid provides high-level abstractions that integrate well with Rails' naming conventions, improving developer productivity.
This seamless integration simplifies tasks like schema definition, query writing, and data modeling, allowing developers to focus on application logic rather than database implementation. Like an ORM, an ODM minimizes the gap between the model and the database.
--- pp.91-92
One of MongoDB's most notable features is its flexible document structure.
It supports BSON documents and arrays with nesting up to 100 levels, which provides practical benefits beyond just technical features.
This deep structure not only maximizes the flexibility of the database, but also allows you to organize data in a way that is optimized for your application's needs.
In particular, these structural features provide three key advantages:
First, it greatly reduces the need for complex join operations.
It also makes the data retrieval process efficient and finally simplifies query writing.
--- p.117
The $gt(greater than) operator is used to search for data that exceeds a specified value.
For example, it is effective for tasks such as finding products above a certain price or viewing transaction details after a reference date.
On the other hand, the $lt (less than) operator is used to find data that is less than a specified value.
This is useful in situations such as identifying products whose inventory quantity is below a certain threshold or retrieving records from a specific period of time.
--- p.153
A key feature of composite indexes is the support for a variety of queries that utilize prefixes on the index fields.
For example, the composite index in the example above supports queries that combine author and ISBN code, as well as queries that use only the author field, which is the first field in the index.
On the other hand, queries performed on ISBN codes alone cannot utilize the index and result in a full collection scan.
(…) Composite indexes store document references in the order of their defined fields.
Figure 10.4 is an example showing this structure.
First, you can see that the sorting is done in ascending order (alphabetical order) based on the userid, and then the scores are sorted in descending order within each userid.
--- p.222
Vector search is a technique for searching based on the meaning of data.
This technology uses a machine learning model called an encoder to convert various data such as text, audio, and images into high-dimensional vectors.
The vectors generated in this way contain the semantic characteristics of the data, so we can find vectors that are close to each other in a high-dimensional space and identify similar content.
These vector searches can effectively complement traditional keyword-based searches.
In particular, it has recently attracted significant attention because it can provide additional information that goes beyond the limitations of large language models (LLMs).
In real-world search, it has the advantage of being able to find relevant results even when the exact search term is unknown, and its usefulness has been proven in various fields such as natural language processing and recommendation systems.
--- pp.255-256
Publisher's Review
The long-awaited, best+latest MongoDB guidebook
Although MongoDB has steadily evolved in a developer-friendly direction, no related books have been published in Korea for some time.
This book is the first official MongoDB book written directly by MongoDB staff.
The original book was written based on the latest version at the time of publication, 7.0, but later version 8.0 was released, and the contents of 8.0 were supplemented with notes and appendices. This Korean translation published by Jaypub is “Mastering MongoDB 7.0 (4th Edition).”
We begin with the fundamentals, including architecture and developer tools, that developers need to understand to utilize MongoDB. This book covers practical topics, including CRUD queries, schema design and data modeling, advanced queries, aggregation pipelines, multi-document ACID transactions, and index optimization, with hands-on examples.
Next, we'll explore the Atlas Developer Data Platform and its related products, which enable you to fully leverage MongoDB as a DBaaS. It's notable for covering how to leverage cutting-edge products like Atlas Vector Search, which is useful for AI applications.
We then explore monitoring and backup, Atlas search, and integration with third-party applications, and cover more advanced topics such as security, auditing, and encryption, including RBAC.
Among all the MongoDB books published in Korea, this one is the best in terms of scope and expertise.
This is not an exaggeration, it is a fact.
Key Contents
● Run advanced queries to gain data insights
● Data transformation leveraging the powerful capabilities of the aggregation pipeline
● Ensure data integrity with multi-document ACID transactions
● Optimizing query performance using strategic indexing techniques
● Monitoring and backup using MongoDB Atlas
● Use powerful search features with Atlas Search
● RBAC, user management, and data encryption for security
Auditing practices that ensure transparency and accountability
Although MongoDB has steadily evolved in a developer-friendly direction, no related books have been published in Korea for some time.
This book is the first official MongoDB book written directly by MongoDB staff.
The original book was written based on the latest version at the time of publication, 7.0, but later version 8.0 was released, and the contents of 8.0 were supplemented with notes and appendices. This Korean translation published by Jaypub is “Mastering MongoDB 7.0 (4th Edition).”
We begin with the fundamentals, including architecture and developer tools, that developers need to understand to utilize MongoDB. This book covers practical topics, including CRUD queries, schema design and data modeling, advanced queries, aggregation pipelines, multi-document ACID transactions, and index optimization, with hands-on examples.
Next, we'll explore the Atlas Developer Data Platform and its related products, which enable you to fully leverage MongoDB as a DBaaS. It's notable for covering how to leverage cutting-edge products like Atlas Vector Search, which is useful for AI applications.
We then explore monitoring and backup, Atlas search, and integration with third-party applications, and cover more advanced topics such as security, auditing, and encryption, including RBAC.
Among all the MongoDB books published in Korea, this one is the best in terms of scope and expertise.
This is not an exaggeration, it is a fact.
Key Contents
● Run advanced queries to gain data insights
● Data transformation leveraging the powerful capabilities of the aggregation pipeline
● Ensure data integrity with multi-document ACID transactions
● Optimizing query performance using strategic indexing techniques
● Monitoring and backup using MongoDB Atlas
● Use powerful search features with Atlas Search
● RBAC, user management, and data encryption for security
Auditing practices that ensure transparency and accountability
GOODS SPECIFICS
- Date of issue: May 20, 2025
- Page count, weight, size: 476 pages | 188*245*23mm
- ISBN13: 9791194587217
You may also like
카테고리
korean
korean