WiredTiger is the default storage engine in MongoDB that manages how data is stored on disk and cached in memory. It uses compression and supports document-level concurrency control for better performance.
Click to reveal answer
beginner
How does WiredTiger use memory for caching?
WiredTiger uses a cache in RAM to store frequently accessed data and indexes. This cache speeds up read and write operations by reducing disk access.
Click to reveal answer
intermediate
What is document-level locking in WiredTiger?
Document-level locking means WiredTiger locks only the specific document being changed, not the whole collection. This allows many operations to happen at the same time without waiting.
Click to reveal answer
intermediate
Why does WiredTiger use compression for data storage?
WiredTiger compresses data to save disk space and reduce the amount of data read from or written to disk, which improves speed and efficiency.
Click to reveal answer
advanced
What happens if the WiredTiger cache is full?
When the cache is full, WiredTiger writes dirty data (changes) to disk to free up space. This process is called checkpointing and helps keep data safe and memory available.
Click to reveal answer
What is the default storage engine in MongoDB?
ARocksDB
BMMAPv1
CInMemory
DWiredTiger
✗ Incorrect
WiredTiger is the default storage engine in MongoDB since version 3.2.
What type of locking does WiredTiger use to improve concurrency?
ADocument-level locking
BDatabase-level locking
CCollection-level locking
DNo locking
✗ Incorrect
WiredTiger uses document-level locking to allow multiple operations on different documents simultaneously.
Why does WiredTiger use compression?
ATo reduce disk space and improve speed
BTo increase disk space usage
CTo slow down data access
DTo encrypt data
✗ Incorrect
Compression reduces disk space usage and speeds up data access by reading and writing less data.
What does WiredTiger do when its cache is full?
ADeletes old data
BWrites dirty data to disk (checkpointing)
CStops accepting writes
DIncreases cache size automatically
✗ Incorrect
WiredTiger writes dirty data to disk to free cache space, a process called checkpointing.
What is stored in the WiredTiger cache?
AOnly indexes
BOnly data
CFrequently accessed data and indexes
DBackup files
✗ Incorrect
The cache holds frequently accessed data and indexes to speed up operations.
Explain how WiredTiger manages memory and storage to improve MongoDB performance.
Think about caching, locking, compression, and writing data safely.
You got /4 concepts.
Describe the benefits of document-level locking in WiredTiger.
Compare locking at document level vs collection level.
You got /3 concepts.
Practice
(1/5)
1. What is the default storage engine used by MongoDB that balances speed and storage?
easy
A. WiredTiger
B. MMAPv1
C. InMemory
D. RocksDB
Solution
Step 1: Recall MongoDB default engine
MongoDB uses WiredTiger as its default storage engine since version 3.2 for better performance and compression.
Step 2: Compare options
MMAPv1 is older, InMemory is for volatile data, RocksDB is not default in MongoDB.
Final Answer:
WiredTiger -> Option A
Quick Check:
Default engine = WiredTiger [OK]
Hint: Default MongoDB engine is WiredTiger [OK]
Common Mistakes:
Confusing MMAPv1 as default
Thinking InMemory is default
Assuming RocksDB is default
2. Which configuration file setting correctly specifies WiredTiger as the storage engine in mongod.conf?
easy
A. storage:
engine: wiredtiger
B. storage:
engine: WT
C. storage:
engine: wiredTiger
D. storage:
engine: WiredTiger
Solution
Step 1: Check correct case for engine name
The engine name is case-sensitive and must be 'wiredTiger' with lowercase 'w' and capital 'T'.
Step 2: Validate YAML syntax
storage:
engine: WT uses unrecognized abbreviation; C uses all lowercase; D uses incorrect capitalization.
Final Answer:
storage:
engine: wiredTiger -> Option C
Quick Check:
Correct engine name is wiredTiger [OK]
Hint: Use exact 'wiredTiger' (lowercase w, capital T) in config [OK]
B. The amount of RAM WiredTiger uses for caching data
C. The number of CPU cores WiredTiger uses
D. The network bandwidth limit for WiredTiger
Solution
Step 1: Understand cacheSizeGB meaning
cacheSizeGB sets how much RAM WiredTiger uses to cache data in memory for faster access.
Step 2: Eliminate other options
It does not control disk space, CPU cores, or network bandwidth.
Final Answer:
The amount of RAM WiredTiger uses for caching data -> Option B
Quick Check:
cacheSizeGB = RAM cache size [OK]
Hint: cacheSizeGB sets RAM cache size for WiredTiger [OK]
Common Mistakes:
Thinking it controls disk space
Confusing with CPU or network settings
Ignoring memory tuning importance
4. You set cacheSizeGB: 0.5 in mongod.conf but MongoDB starts with poor performance. What is the likely cause?
medium
A. cacheSizeGB must be at least 1 GB
B. cacheSizeGB cannot be a decimal value
C. cacheSizeGB must be set under storage.engine directly
D. cacheSizeGB is ignored and does not affect startup
Solution
Step 1: Check WiredTiger cache size limits
WiredTiger performs poorly if cacheSizeGB is less than 1 GB.
Step 2: Validate config placement and value type
Decimal values are allowed; placement under wiredTiger.engineConfig is correct; it is not ignored.
Final Answer:
cacheSizeGB must be at least 1 GB -> Option A
Quick Check:
Minimum cacheSizeGB = 1 GB [OK]
Hint: cacheSizeGB minimum is 1 GB for good performance [OK]
Common Mistakes:
Using decimal values thinking they are invalid
Placing cacheSizeGB under wrong config section
Assuming cacheSizeGB is optional for startup
5. You want to optimize MongoDB performance on a server with 16 GB RAM. Which cacheSizeGB setting is best for WiredTiger, considering MongoDB and OS need memory?
hard
A. Set cacheSizeGB to 14 to maximize cache
B. Set cacheSizeGB to 16 to use all RAM for cache
C. Set cacheSizeGB to 2 because more cache slows down MongoDB
D. Set cacheSizeGB to 8 to leave memory for OS and other processes
Solution
Step 1: Understand memory needs
MongoDB needs memory for cache and other operations; OS and other apps also need RAM.
Step 2: Choose balanced cache size
Setting cacheSizeGB to about half or slightly more (8 GB) leaves enough RAM for OS and avoids swapping.
Step 3: Evaluate other options
14 or 16 GB risks OS starvation; 2 GB is too low for good performance.
Final Answer:
Set cacheSizeGB to 8 to leave memory for OS and other processes -> Option D
Quick Check:
Balance cache and OS memory = 8 GB [OK]
Hint: Use about half RAM for cache to keep system stable [OK]
Common Mistakes:
Assigning all RAM to cache causing OS issues
Setting too low cacheSizeGB hurting performance
Ignoring OS memory needs
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.