MongoDB DBA EXAM
What is the most important factor in choosing a shard key ? - Answer- knowledge of the read and write workloads of the application Where do all non-sharded collections get stored in a sharded cluster? - Answer- Primary shard What is sharding? - Answer- 1. a method of distributing data across multiple machines 2. a method to ensure data availability Where is the the $out stage ? - Answer- The $out stage must always be run on the primary shard for a sharded collection. Where is the the $lookup stage ? - Answer- The $lookup stage must always be run on the primary shard for a sharded collection. Upsert - Answer- Update call that inserts a new document if no update match is found. Allows the same code to be used for inserts as well as updates. Upsert is indicated by a third parameter which is a boolean in the update statement. ex: db.col.update({selector},{document},true); Multi-updates - Answer- Updates all matching documents, not just the first, that match the selector. This behavior is chosen by passing a boolean to the fourth update call parameter. ex: db.col.update({selector},{document},upsertBool,true}); What information can be obtained from running rStatus()['repl'] on a secondary replica set node? - Answer- 1. The name, port, and IP address of the primary node 2. The replica set name 3. Whether the node is a primary or a secondary The $size operator is used to check the size of: - Answer- an array field When creating an index on an array field, what type of index is created? - Answer- multikey index To parallelize IO throughput using symlinks - Answer- To parallelize IO throughput using symlinks You can use --directoryperdb and --wiredTigerDirectoryForIndexes and symlink those directories to separate volumes to horizontally scale IO. {"atype": "authCheck"} - Answer- Most DML operations fall under the authCheck action type.
Written for
- Institution
- MONGODB
- Course
- MONGODB
Document information
- Uploaded on
- September 6, 2023
- Number of pages
- 9
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
mongodb dba exam
-
what is the most important factor in choosing a sh