MongoDB
MongoDB is a document-oriented NoSQL database that stores data in flexible, JSON-like documents. In our system, MongoDB plays a crucial role in storing aggregated data generated by serverless functions. These functions read raw ADS/IDS data from OpenSearch, process and summarize it, and then write the resulting insights into MongoDB for easy consumption.
MongoDB Version: 7.0.14
Key Characteristics:
Document-Oriented:
Data is stored in documents, allowing for a flexible schema that can adapt as requirements change.Collections:
Documents are grouped into collections. For example, our aggregated data is organized in collections that summarize network events and other metrics.Scalability & Flexibility:
MongoDB’s architecture supports horizontal scaling, making it ideal for managing large volumes of aggregated data without sacrificing performance.
This overview provides a quick reference for understanding how MongoDB is used within our ecosystem and its fundamental structure for storing and retrieving data.
A SQL user's reference to MongoDB
For users coming from a SQL background, here's a quick reference to help you map common SQL concepts to MongoDB terminology.
SQL Term | MongoDB Term | Description |
|---|---|---|
Database | Database | Both store data; a MongoDB database contains collections instead of tables. |
Table | Collection | A collection in MongoDB is analogous to a table in SQL, grouping related documents. |
Row | Document | A document is similar to a row, stored as a JSON-like object with flexible fields. |
Column | Field | A field in a document is equivalent to a column in a SQL table. |
Schema | Schema-less | MongoDB allows a flexible, schema-less structure, though you can enforce schema with validation. |
Primary Key | _id Field | MongoDB automatically creates a unique _id field for each document, serving as the primary key. |
Query | Query | Both systems support querying; MongoDB uses a JSON-like syntax for queries. |
Index | Index | Indexes work similarly in both systems to improve query performance. |
Join | Aggregation/Lookup | Instead of SQL joins, MongoDB uses the aggregation framework and the |
This table provides a concise translation of key terms, easing the transition from SQL to MongoDB.
Additional Resources for Learning MongoDB
For those new to MongoDB or looking to deepen their understanding of its core operations, the following resources provide comprehensive guides and tutorials on queries, operations, aggregations, counts, and more:
MongoDB Manual:
MongoDB Manual – The official documentation covering installation, configuration, and advanced topics.CRUD Operations:
CRUD Operations – Learn how to create, read, update, and delete documents in MongoDB.Querying Documents:
Query Documents – A detailed guide on how to query your data using MongoDB’s query language.Aggregation Framework:
Aggregation Pipeline – Explore how to use the aggregation framework to process and transform your data.Indexing:
Indexes – Understand how to implement indexing strategies to optimize query performance.Counting Documents:
Count Documents – Documentation on methods to count documents within a collection.MongoDB University:
MongoDB University – Access free online courses and training for MongoDB developers and administrators.