Which of the following is a recommended practice when using transactions in MongoDB?
Keeping transactions short-lived and focused to minimize locking overhead and potential for conflicts.
Including as many operations as possible within a single transaction to simplify code logic.
Keeping transactions as long-running as possible to maximize the number of operations covered.
Avoiding the use of indexes within transactions as they can negatively impact performance.
What is the primary purpose of using transactions in MongoDB?
To create backups and restore data in case of failures.
To improve query performance for individual operations.
To enable data replication across multiple MongoDB clusters.
To ensure atomicity, consistency, isolation, and durability (ACID) properties for multiple operations.
What does the 'Extended Reference' pattern in MongoDB schema design aim to achieve?
Combining embedding and referencing for optimal performance
Storing an entire referenced document within the main document
Creating a denormalized view of data for specific queries
Enforcing data integrity rules across multiple collections
What is a key difference between single-document writes and multi-document transactions in MongoDB?
Single-document writes offer ACID guarantees, while multi-document transactions do not.
Single-document writes are only supported in sharded clusters, while multi-document transactions work in both standalone and sharded environments.
Multi-document transactions provide atomicity across multiple documents, while single-document writes do not.
Multi-document transactions can only update a single document at a time.
Which geospatial query operator in MongoDB finds documents within a specific radius?
$nearSphere
$geoWithin
$geoIntersects
$near
Which component of MongoDB's architecture is responsible for managing data access and concurrency?
Storage Engine
Query Engine
Router
Config Server
Which component in a sharded cluster is responsible for routing read and write operations to the appropriate shards?
Mongos router
Replica set
Shard server
Config server
In a MongoDB replica set, which node accepts write operations?
Secondary
Any node
Primary
Arbiter
What is the primary advantage of using a compound index in MongoDB?
Improved performance for text search queries.
Faster retrieval of documents matching multiple fields.
Simplified management of index structures.
Reduced memory consumption for storing index data.
During a read operation in MongoDB, if the requested data is not found in the WiredTiger cache, where is it retrieved from?
Oplog
Journal Files
Config Servers
Data Files