What is the purpose of 'write concern' in MongoDB?
To manage data compression for write operations.
To limit the number of writes per second.
To control how many nodes must acknowledge a write operation.
To specify the level of security for write operations.
Which sharding strategy allows for geographically distributing data to optimize for local user access?
Ranged sharding
Random sharding
Hashed sharding
Zone sharding
What is the primary purpose of roles in MongoDB's authorization system?
To encrypt data at rest
To define granular permissions for database operations
To manage user authentication
To enforce data validation rules
In a compound index {field1: 1, field2: -1}, what does the '-1' signify for 'field2'?
Ascending order sort.
Descending order sort.
Exclude 'field2' from the index.
Mark 'field2' as a sparse field.
What is a common reason for slow query performance despite having an index on the queried field?
The indexed field has low cardinality (many documents share the same value)
The index is too large to fit entirely in RAM
The query uses a projection to select only a subset of fields
The collection has a large number of documents
Which write concern level ensures that a write operation is durable even if the primary node fails?
w: majority
w: all
w: 0
w: 1
What is a key consideration when choosing the order of fields in a compound index?
Frequency and selectivity of query conditions.
Alphabetical order of field names.
Size of the data stored in each field.
Data type of the fields (e.g., string, number).
What is a shard key in MongoDB's sharding system?
A unique identifier assigned to each shard server
An encryption key used for securing data on shards
A password used to authenticate connections to the cluster
A field or set of fields used to distribute data across shards
What is the significance of regularly rotating encryption keys used with MongoDB?
It prevents data corruption within the database.
It mitigates the impact of a potential key compromise.
It improves query performance by reducing index size.
It enables faster data recovery after a server failure.
What is the primary advantage of using hashed sharding in MongoDB?
Optimizing range-based queries
Simplifying data migration between shards
Ensuring even data distribution across shards
Reducing the need for a shard key