Book Image

Practical MongoDB Aggregations

By : Paul Done
Book Image

Practical MongoDB Aggregations

By: Paul Done

Overview of this book

Officially endorsed by MongoDB, Inc., Practical MongoDB Aggregations helps you unlock the full potential of the MongoDB aggregation framework, including the latest features of MongoDB 7.0. This book provides practical, easy-to-digest principles and approaches for increasing your effectiveness in developing aggregation pipelines, supported by examples for building pipelines to solve complex data manipulation and analytical tasks. This book is customized for developers, architects, data analysts, data engineers, and data scientists with some familiarity with the aggregation framework. It begins by explaining the framework's architecture and then shows you how to build pipelines optimized for productivity and scale. Given the critical role arrays play in MongoDB's document model, the book delves into best practices for optimally manipulating arrays. The latter part of the book equips you with examples to solve common data processing challenges so you can apply the lessons you've learned to practical situations. By the end of this MongoDB book, you’ll have learned how to utilize the MongoDB aggregation framework to streamline your data analysis and manipulation processes effectively.
Table of Contents (20 chapters)
2
Part 1: Guiding Tips and Principles
7
Part 2: Aggregations by Example
16
Afterword

What do developers use the aggregation framework for?

The aggregation framework is versatile and used for many different data processing and manipulation tasks. Some typical use cases include the following:

  • Generating business reports, which include roll-ups, sums, and averages
  • Performing real-time analytics to generate insight and actions for end users
  • Presenting real-time business dashboards with an up-to-date summary status
  • Performing data masking to securely obfuscate and redact sensitive data ready to expose to consumers via views
  • Joining data together from different collections on the server side rather than in the client application for improved performance
  • Conducting data science activities such as data discovery and data wrangling
  • Performing mass data analysis at scale (i.e., big data) as a faster and more intuitive alternative to technologies such as Hadoop
  • Executing real-time queries where deeper server-side data post-processing is required than what is available via default MongoDB Query Language
  • Navigating a graph of relationships between records, looking for patterns
  • Performing the transform part of an extract, load, transform (ELT) workload to transform data landed in MongoDB into a more appropriate shape for consuming applications to use
  • Enabling data engineers to report on the quality of data in the database and perform data-cleansing activities
  • Updating a materialized view with the results of the most recent source data changes so that real-time applications don't have to wait for long-running analytics jobs to complete
  • Performing full-text search and fuzzy search on data using MongoDB Atlas Search, see https://www.mongodb.com/atlas/search
  • Exposing MongoDB data to analytics tools that don't natively integrate with MongoDB via SQL, ODBC, or JDBC (using MongoDB BI Connector, see https://www.mongodb.com/docs/bi-connector/current/, or Atlas SQL, https://www.mongodb.com/atlas/sql)
  • Supporting machine learning frameworks for efficient data analysis (e.g., via MongoDB Spark Connector, see https://docs.mongodb.com/spark-connector)