What will this article cover?
This article will focus on why you should consider attending a free MongoDB University course, why I did, and why you should think about getting your MongoDB certification in 2023/2024.
Tips for new DBAs with the certification exam:
1. Attend MongoDB University: It’s useful for beginners and for expert DBAs too – I found all the courses very useful; don’t underrate it.
2. Take your time: during the exam to read the questions and problem statements thoroughly and make sure you understand them fully. As with many exams, some questions require deeper analysis than you might think at first glance.
3. Review MongoDB documentation: I found MongoDB University useful as starting point to get certified as a MongoDB Developer. However, subsequently reviewing the MongoDB documentation will provide more insights and bolster exam readiness.
4. Key Technical areas: I’ve taken below notes from Arek Borucki blog which I went through and cleared the certification and added few more to the list based on my experience.
5. The basics: I saw few questions related to asking basic DML operations, size of chunks /documents/
6. Understanding of MongDB Architecture: like what is documents, collections etc ..
7. Indexes: I think this area is the most important one (it is also very useful when you work day by day with MongoDB). MongoDB offers a broad range of index types and features with language-specific sort orders to support complex access patterns to your data and on exam you will have many different questions related to different type of indexes and you will have to understand the differences between the various variations.
a. Compound Indexes – where a single index structure holds references to multiple fields — pay attention to order of the fields listed in a compound index. You will have exam questions if examples of queries can use compound index or not. Compound index supports queries that match on all the index fields, can also support queries that match on the prefix of the index fields.
b. Sort with compound index – If the sort keys correspond to the index keys or an index prefix, MongoDB can use the index to sort the query results. A prefix of a compound index is a subset that consists of one or more keys at the start of the index key pattern. You will have few questions if given query can use compound index for sorting or for filtering and sorting.
c. Multikey Indexes – To index a field that holds an array value, MongoDB creates an index key for each element in the array. You will be ask how to create index of array and about limitations of multikey index. Remember that you cannot create a compound multikey index if more than one to-be-indexed field of a document is an array about limitations of multikey index. Remember that you cannot create a compound multikey index if more than one to-be-indexed field of a document is an array.
d. Partial Indexes – Partial indexes only index the documents in a collection that meet a specified filter expression. It reduces performance costs for index creation and maintenance. Exam question will ask whether the query will take advantage of partial indexes. You can check it via partialFilterExpression option.
e. Covered query – is a query that can be satisfied entirely using an index and does not have to examine any documents. You will have to distinguish whether the query is covered or not.
f. Sort with index – sort operations can obtain the sort order by retrieving documents based on the ordering in an index. If the query planner cannot obtain the sort order from an index, it will sort the results in memory. You will have to distinguish whether the query use index for sort or not. Make sure you will read about ascending (1) or descending (-1) sort order in context of compound index.
g. Index and Collation – you will need to judge if query operation, which specifies the same collation as the index, can use the index.
h. Query Plans and Explain Results – it is very important topic, and you will have many questions related to this area. Read how MongoDB query optimizer chooses the most efficient query plan and when plan can be changed also about Explain Results and explain command in context of unsharded and sharded collections . Pay attention to Verbosity Modes.
8. Sharding. : MongoDB uses sharding to support deployments with very large data sets and high throughput operations. Understanding of this topic is essential for the exam. You can expect many questions related to shard clusters.
a. Shard Cluster Architecture – make sure you understand all components of shard cluster. You need to know key responsibilities of mongoS, config servers also when to start shard your cluster.
b. Shard Keys. – you will be ask to choose optimal shard key for given query examples. Remember that the most frequently used queries should use the key and shard collections must have an index that supports the shard key. If you use compound index the shard key must be a prefix of the index.
c. Immutable key – once you shard a collection, the selection of the shard key is immutable, i.e., you cannot select a different shard key for that collection, starting in MongoDB 4.2 you can update a document’s shard key value unless the shard key field is the immutable _id field.
d. Hashed Sharding – provides more even data distribution across the sharded cluster at the cost of reducing range query capabilities and shard zones functionality.
e. Shard key on _id field – “_id” file has a high cardinality and low frequency but is monotonically increasing due to ObjectId. Good idea is to choose this field as hashed shard key
f. Primary Shard – Each database in a sharded cluster has a primary shard that holds all the un-sharded collections for that database. Also Aggregation Pipeline which is running on shard cluster will execute the $out stage and the $lookup stage on the database primary shard.
g. Chunks – A chunk consists of a subset of sharded data. Remember that each chunk has a inclusive lower and exclusive upper range based on the shard key.
h. Balancer– balancer is a background process that monitors the number of chunks on each shard. It is worth to learn Migration Thresholds, how to start or stop balancer, also other commands for balancer management
i. Sharding Methods – sh.status() is very important from exam point of view. Execute sh.status() on mongoS in your shard cluster and try to memorize as many information as possible. It will help on exam.
9. Replication – One more important exam area – learn all capabilities of statement based replication mechanism in MongoDB which provides redundancy and high availability.
a. Replica Set Election – The rule is that the majority of the replica set needs to be up to successfully elect a primary.
b. Replication Methods – rs.status() method is important from exam point of view. Execute rs.status() on your replica set and try to memorize all information in returned document about replication.
c. db.isMaster() – execute db.isMaster() method and see document that describes the role of the mongod instance.
d. Replica Set Arbiter – Arbiter is a light weight process they do not consume much hardware resources, hey are just to vote in election when there is any node failure. We should avoid arbiters in production deployments.
e. Hidden Replica Set Members – to run ad-hoc or analytics query or make backups, highly recommended is to properly configure replica set. In particular, adding a node designated for analytics or for backups as a hidden, non-electable member of the replica set. Hidden members have properties that make them great for analytics.
f. Delayed Replica Set Members – delayed member’s data set reflects an earlier, or delayed, state of the set. delayed members are a “rolling backup” or a running “historical” snapshot of the data set, they may help you recover from various kinds of human error. Must be priority 0, and also should be hidden.
10. Security – you can expect number of questions related to authentication, access control, encryption and auditing.
a. you need to distinguish between Authentication and Authorization
b. Authentication Methods – To authenticate as a user, you must provide a username, password, and the authentication database associated with that user. You need to also know how to use db.auth() method.
c. RBAC – how to enable role access control, it is also important to know what are the roles , what they consist of, how to grant roles to users and how to display role privileges, db.getRoles() method is very useful.
d. Built-In Roles – make sure you have good understanding of MongoDB’s built-in roles. MongoDB provides the built-in database user and database administration roles on every database. MongoDB provides all other built-in roles only on the admin database. Example of database administration roles: dbAdmin, dbOwner, userAdmin.
e. TLS/SSL – there is number of questions related to Transport Layer Security. TLS/SSL settings are important for exam. You need to know difference between “–tlsCAFile” and “–tlsCertificateKeyFile” and know how to usex.509 Certificate for Membership Authentication, and when to use preferTLS mode.
f. Encryption at Rest – MongoDB Enterprise supports secure transfer of keys with Key Management Interoperability Protocol (KMIP) compliant key management appliances. You should know the benefits of using KMIP server like master key rotation or capability for the keys to be stored in the key manager.
g. Auditing – MongoDB Enterprise includes an auditing capability for mongod and mongos instances. For exam you should know the difference between MongoDB DDL (create collection, create database, create index, rename collection, drop collection, drop database, drop index) and DML (CRUD), also you should know how to enable CRUD operations for auditing and why is disabled by default (too many logs, performance loss).
11. CRUD – of course the CRUD operation could not be missing. Important CRUD operation for C100DBA exam are: find(), updateOne(), updateMany(), replaceOne(), insertOne(), insertMany().
a. make sure you know and understand find() method well together with important Query and Projection Operators:Comparison–$gt,$gte,$in,$ne$eq. Logical – $and, $or, Element- $exists, Array – $all, $elemMatch, $size
b. projections techniques– for example how to remove the _id field from the results by setting it to 0 in the projection.
c. know the difference between $and and implicit AND operation.
d. know the difference between updateOne() and replaceOne()
e. understand write concern levels and the wtimeout option.
f. understand available read concern and pay attention to majority and linearizable.
g. know that db.collection.find() method returns a cursor and you need to iterate the cursor. In the mongo shell the cursor is automatically iterated up to 20 times.
Is the certification exam easy or hard?
My exam took place in June 2023. The week before the exam, I revised using the resources available across the MongoDB website to make sure I didn’t forget any details.
It is conducted by a live ‘Proctor’ (like an invigilator) who checks that the exam is correctly made, and they also help you configure your computer properly (webcam, screen-sharing, etc.).
The proctor tells you when everything is ready, and the exam can begin.
As it started, I noticed the questions were harder than the ones I found in the free pre-exam test, but I remembered the lessons I learned: don’t rush! After 30 minutes I decided to pause for a few minutes to relax.
Is getting the MongoDB associate certification worth it?
The certification exam was an amazing journey that helped me revisit old concepts and learn new features. I would highly recommend it for all MongoDB DBAs. Challenge yourself to break the daily routine – you may have much more to learn than your realized!