MongoDB DBA EXAM

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

MongoDB Ops Manager includes...

--> Database Monitoring --> Query Optimization --> Backup --> Automation

Which of the following are sharding methods?

--> Range --> Zone --> Hash

BI Connector

--> able to use Qlik to visualize their MongoDB data. --> It is intended to work with any SQL-based BI tool --> It allows organizations with BI tools that only speak SQL to make use of MongoDB data

Select all statements that accurately describe how the updateOne command works in conjunction with the $set operator.

1. $set updates an existing document field with the given value 2. updateOne in conjunction with $set updates the first document that matches the query used as the first parameter 3. if the field does not exist, $set will add a new field with the specified value

Which of the following actions is a user with the clusterManager built-in role able to perform?

1. Add nodes from a replica set 2. Resync a replica node 3. Remove shards

component of ACID

1. Atomicity 2. Consistency 3. Isolation 4. Durability

Premium features of Atlas that are available a la carte:

1. Database Auditing 2. LDAP Integration 3. Encryption Key Management 4. BI Connector

Select the appropriate option(s) below that should always be kept in mind regarding indexes:

1. Indexes should be taken into consideration for sizing and maintenance 2. Indexes are part of the database "working set" 3. Indexes are data structures that require additional resources as they grow

3 things go into determining the cost of Atlas

1. Instance Size 2. Network Transfer Costs 3. Backup

Which of the following is true in relation to the encrypted storage engine in MongoDB?

1. Master keys are stored outside MongoDB. This is true, we recommend that you use KMIP to manage these keys. 2. Database keys are stored inside MongoDB. This is also true, there is a key per database stored inside MongoDB.

Which of the following properties must be specified when creating a user-defined role?

1. Role name 2. Set of privileges 3. Inherited roles

What authentication mechanisms are available in the community version of MongoDB?

1. SCRAM 2. X.509

What information can be obtained from running db.serverStatus()['repl'] on a secondary replica set node?

1. The name, port, and IP address of the primary node 2. The replica set name 2 .Whether the node is a primary or a secondary

What information can be obtained from running db.serverStatus()['repl'] on a secondary replica set node?

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

What is sharding?

1. a method of distributing data across multiple machines 2. a method to ensure data availability

Having a good compound shard key on a collection:

1. allows for even distribution of the collection 2. helps avoid potential un-splittable jumbo chunks

In order to store data in a sharded cluster in MongoDB, you must have

1. config servers 2. at least one shard 3. a mongos process

After changing the write concern to w: "majority", this operation is:

1. more likely to take longer 2. less likely to be rolled back 3. more likely to block other operations in the application

commands can be used to retrieve the size of the oplog in a MongoDB replica set

1. rs.printReplicationInfo() 2. db.oplog.rs.stats()

At which point does the balancer decide to start moving chunks from one shard to another?

1. there has been a request to drain a shard due to a removeShard command 2. when some shards have too many chunks compared to others 3. zone sharding is used and some chunks are identified to be on the wrong shard

The config database in a sharded cluster contains information such as:

1.The distribution of chunks and chunk boundaries 2. The primary shard for a database

Which are valid read concerns in MongoDB?

1.majority 2. linearizable 3. local

What is the size limit of a journal file?

100MB

core capabilities of Atlas

2. Stitch: Serverless Platform Services 3. Managed Backup 5. Comprehensive monitoring 6. Enterprise-grade security & SLAs

When configuring a new replica set to use keyfile authentication, which of the following applies?

After starting the first member with keyfile authentication enabled, the first user must be created via the localhost exception. The same keyfile needs to be configured on each member.

Product Owner

Compiles the product backlog

CRUD stands for:

Create, Read, Update, Delete

dbAdminAnyDatabase

Following the principle of least privilege (POLP), we should grant the user the role that grants the minimal set of privileges the user needs. In this case, the user will be required to administer any database in the cluster. The role dbAdminAnyDatabase would be the most suited for the task.

The config servers

In a sharded cluster, the config servers store all user data used to authenticate to mongos.

{"userId": <String>, "last_login": {"$gte": <ISODate> } }

In case of equally fulfilling query predicates for the feature at hand, developers should use the most optimized query possible. Given that we are dealing with a sharded query, the choice should always fall on routed queries, queries that can be serviced by the shard key, which in this case can only be satisfied by this option

Which of the following is true in respect of the command rs.config()

Lists the set of nodes of a replica set rs.config() provides the current configuration of the replica set. The command is executed in the context of a replica set All mongo shell command helpers that start with rs are executed in the context of a replica set cluster

Transport layer

MongoDB uses TLS 1.1+ to encrypt client-server and intra-cluster network transport layer communication.

Sharding

MongoDB's way of accommodating growing data volumes through horizontal scalability.

{"atype": "authCheck"}

Most DML operations fall under the authCheck action type.

Where do all non-sharded collections get stored in a sharded cluster?

Primary shard

speed up reads

SECONDARY INDEXES

Atlas core capabilities include :

Self-service, elastic, automated Global and highly available Secure by default Comprehensive monitoring

Scrum master

Serves as the project manager for orchestrating the agile process

Developers

Small team of engineers tasked with building the code specified in the backlog

$elemMatch.

The $elemMatch operator allows for rich query expression that will be used to test elements in an array.

Where is the the $lookup stage ?

The $lookup stage must always be run on the primary shard for a sharded collection.

Where is the the $out stage ?

The $out stage must always be run on the primary shard for a sharded collection.

In a sharded cluster with authentication enabled, a user must authenticate before accessing a mongos process. Where is this user data stored?

The config servers In a sharded cluster, the config servers store all user data used to authenticate to mongos.

w: 2

The default write concern is w: 1, and waiting for 2 nodes to apply a write is more durable than only waiting for 1 node to apply it.

mongodump

The free utility for performing backups in MongoDB.

Most efficient index

The most efficient index for the given query should follow the equality, sort, range rule, where the compound index is built in this order for a query that employs equality, range and sort conditions in it. This rule helps to avoid inefficient operations such as a full collection scan or in memory sort.

binary and statement-based replication have in common

They both provide availability in a database server.

What do binary and statement-based replication have in common?

They both provide availability in a database server. Replicating data provides availability in a database server, because it keeps multiple servers up-to-date and ready to serve database requests.

Atlas Data Lake

This capability allows you to quickly query data in any format on Amazon S3 using the MongoDB Query Language (MQL

Atomicity

This guarantee ensures that a transaction is 'all or nothing.

w: 1

This is already the default write concern in MongoDB, so it does not represent a higher durability than the default.

profiler levels 0

This profiling level will not record any events to the system.profile collection.

profiler levels 1

This profiling level will record all operations that exceed the slowms limit, which is 100ms by default.

profiler levels 2

This profiling level will record all operations, regardless of how long they take.

w: 0

This will not wait for any nodes to apply a write before sending an acknowledgement, so it is a less durable write than the default value of w: 1.

To parallelize IO throughput using symlinks

To parallelize IO throughput using symlinks You can use --directoryperdb and --wiredTigerDirectoryForIndexes and symlink those directories to separate volumes to horizontally scale IO.

Upsert

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

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});

How can you increase the cardinality of the shard key?

Use a compound shard key. Using a compound shard key creates more possibilities for the value of the shard key, by using each unique combination of all the fields in the key.

Which of the following statements is true with regard to the localhost exemption?

You can create the first user when connecting to a newly configured mongod from localhost.

The $size operator is used to check the size of:

an array field

Which of the following is the correct command line option to set up an audit filter on a mongod process at startup?

auditFilter will allow you to specify an audit filter at startup for a mongod.

Aggregation Framework

be able to perform analytics in MongoDB.

Data Validation

ble to set rules that check for the existence of a field in their documents before they are allowed to be created.

Before sharding a collection, by running the sh.shardCollection command in the mongo shell, which operation is required?

create an index on the shard key

Database users created with the built-in role readWriteAnyDatabase are allowed to:

create documents in any database

When is it most beneficial to use a hashed shard key?

for a monotonically changing shard key

Having a good compound shard key on a collection:

helps avoid potential un-splittable jumbo chunks In the case where a chunk's upper bound is equal to its lower bound, it can not be split, which hinders the benefits of horizontal scaling. Creating a compound key mitigates that, by adding an additional criteria for chunk upper an lower bounds. This allows chunks with identical value on one field to be split by the values of another field in the shard key. allows for even distribution of the collection Having a good compound shard key can only improve the collection distribution because it adds a parameter for the distribution criteria.

Given the following query: db.animals.find( {}, { "_id": 0, "species": 1, "name": 1, "number_of_chromosomes": 1 } ).sort( { "number_of_chromosomes": -1 } ) and the following index: COPY { "number_of_chromosomes": 1 } How will the data get retrieved, and why?

index scan in descending order without the need to sort This is because when we are sorting with a single field index, we can always sort our documents either in ascending or descending order regardless of the physical ordering of the index keys.

mongorestore operates using data in BSON

it imports that collection into the database

mongodump operates using data in BSON

it removes data from database

What is the most important factor in choosing a shard key ?

knowledge of the read and write workloads of the application

Which of the following is the most important factor in choosing a shard key?

knowledge of the read and write workloads of the application

Which are valid read concerns in MongoDB?

majority read concern reads data that was written to a majority of nodes. local read concern reads data at least written to the primary. It is the default read concern linearizable read concern reads data written to a majority of nodes prior to the read request, and unlike majority will wait for pending write operations to complete that would modify the document(s) requested

When creating an index on an array field, what type of index is created?

multikey index

For any MongoDB CRUD operations that modify only one document, such as db.collection.deleteOne(),

only the first matched document will be modified.

mongoimport and mongoexport

operates using JSON and CSV

Which collections in the local database are replicated by secondary nodes in a MongoDB replica set?

oplog.rs The oplog collection is replicated by secondary nodes to perform any new operations. This is the only collection in the local database that is replicated by secondary nodes.

Aggregation Framework

perform analytics in MongoDB

What is the default mode when using explain to analyze a query?

queryPlanner. This is to allow immediate use on a server that may already be under heavy load to help the administrator determine if a query would have used an index without impacting other operations more heavily

Given a replica set and the following set of commands run from the secondary node (port 27003, node name: r3) of the replica set: use admin db.shutdownServer() What will be the result of the following shell command? mongod --port 27003 --dbpath /data/r3 --logpath /data/r3/r3.log --fork

r3 will be run as a standalone node. This is because the command did not include the --replSet option, even though all other configurations stayed the same. All other answers are incorrect.

local read concern

reads data at least written to the primary. It is the default read concern

majority read concern

reads data that was written to a majority of nodes.

linearizable read concern

reads data written to a majority of nodes prior to the read request, and unlike majority will wait for pending write operations to complete that would modify the document(s) requested

mongostat

returns the statistics about the mongod server currently running and thus will not aid in adding a collection to the database

Which command would you use to add an arbiter to an existing replica set on host mongo2, running on port 27017?

rs.addArb("mongo2:27107")

You need to set up a replica set. Which command(s) do you need to run to set up the replica set and add 2 other nodes?

rs.initiate(); rs.add(node2); rs.add(node3);

Which of the following commands can be used to retrieve the size of the oplog in a MongoDB replica set?

rs.printReplicationInfo() This will return the size of the oplog in both gigabytes and minutes. db.oplog.rs.stats() This will return all available stats on the oplog.rs collection.

Which is true of scatter gather queries?

the mongos has to go to each shard to check if the shard has the requested documents

Select all statements that accurately describe how the updateOne command works in conjunction with the $unset operator.

the specified value in the $unset expression does not impact the operation if the field does not exist, $unset does nothing the $unset operator deletes a particular field Ref: https://www.mongodb.com/docs/manual/reference/operator/update/unset/

MongoDB Compass

visualize the schemas in your MongoDB environment.

In a 3-node replica set, which of the following write concerns are more durable than the default?

w: 2 The default write concern is w: 1, and waiting for 2 nodes to apply a write is more durable than only waiting for 1 node to apply it.

Select the resource definition that best describes all collections named products in any database.

{ "db": "", "collection": "products" }

Which audit filter will successfully audit data manipulation language (DML) operations?

{"atype": "authCheck"} Most DML operations fall under the authCheck action type.


Ensembles d'études connexes

Chapter 26: Upper Respiratory Problems

View Set

Chapter 7 Distribution of Sample Means

View Set