(F) MongoDB Flashcards
What is MongoDB
- MongoDB is a document-oriented NoSQL database, ideal for handling large volumes of data with a flexible schema.
- Mongo’s flexiblity supports polymorphic data structures making it ideal for dynamic environments based on changing requirements.
- Its scalability suits cloud based systems and high-demand applications.
Sidenote:
MongoDB is not a relational database. It’s a document-oriented NoSQL database, meaning it stores data in flexible, schema-less documents, rather than in tables with fixed schemas like relational databases.
What is MongoDB architecture and its 4 components.
- MongoDB’s querying process involves analyzing queries for optimal indexing, translating them into document requests
- The database server manages data storage and retrieval efficiently using the storage engine.
- Replica sets ensure high availability and data redundancy by distributing data across primary and secondary nodes.
- Sharding enables MongoDB to horizontally scale by partitioning data across multiple machines.
Advantages and Disadvantages of MongoDB
Advantages
- Scalability: easy to scale out using sharding and replication
- Flexible schema: allows dynamic modification of the schema without downtime
- Performance: Optimized for both read and write operations, supports in-memory processing
Disadvantages
- Memory Usage: Higher memory usage due to its data storage format (BSON) compared to a traditional relational databases.
- Management Complexity: Sharding and replication can introduce complexity in management and maintenance
- Eventual Consistency: MongoDB offers eventual consistency, which might not be adequate for applications requiring immediate consistency across all nodes.
What is MongoDB query language?
-MongoDB uses MQL (MongoDB Query Language), which is a language designed for easy data manipulation and retrieval from single collections.
- Secondly is Aggregation Framework: A powerful framework that allows performing complex data processing and transformation operations through a multi-stage pipeline.
What is MongoDB data model?
MongoDB organizes data in documents, which are grouped into collections. Documents can contain many levels of nested structures, and a collection can store a variety of documents. This flexibility allows the data model to closely match the needs of application.
What is MongoDB Data Storage?
MongoDB uses the WiredTiger storage engine by default, which supports data compression and is optimized for high concurrency and low latency. Data is stored in collections of BSON documents that supports both replication and sharding to enhance performance and ensure data integrity.