Sunday, 8 January 2017

MongoDB Course M102: MongoDB for DBAs Homework 5.2

I decided to go over M102 Homework 5.2 in more detail as it seems to throw some people. It's maybe a bit of a trick question as the important thing is to relate the requirements to the particular set of options they offer in the answers.

Here is the question as written in May 2016:
You have just been hired at a new company with an existing MongoDB deployment. They are running a single replica set with two members. When you ask why, they explain that this ensures that the data will be durable in the face of the failure of either server. They also explain that should they use a readPreference of "primaryPreferred", that the application can read from the one remaining server during server maintenance.
You are concerned about two things, however. First, a server is brought down for maintenance once a month. When this is done, the replica set primary steps down, and the set cannot accept writes. You would like to ensure availability of writes during server maintenance.
Second, you also want to ensure that all writes can be replicated during server maintenance.
Which of the following options will allow you to ensure that a primary is available during server maintenance, and that any writes it receives will replicate during this time?
Check all that apply.

The parts I've emboldened are actually the only bits we need to consider. Note that there are two requirements in the question.

To allow writes, the remaining members must have a majority to elect a primary. Therefore we need to have three or more members in total to allow writes when one is down for maintenance. So we know we need to add a member to our deployment.

To allow writes to be replicated, there needs to be a data-bearing primary with a data-bearing secondary to replicate to. Therefore, we need to add at least one data-bearing member to our current deployment to satisfy that requirement. This is really the "trick" to the question.

So, let's look at the options they give us:

1. Add an arbiter
2. Add two data bearing members plus one arbiter
3. Increase the priority of the first server from one to two
4. Add another data bearing node
5. Add two arbiters

Options 1, 3, and 5 do not add a data-bearing member, therefore we can ignore them as they do not satisfy the second requirement: they will not allow writes to be replicated during maintenance. Not that it matters, but Option 3 doesn't satisfy the first requirement either.

This leave only Options 2 and 4 that meet the requirements and are the correct answers.

Not that hard really, we just need to remember that arbiters are only useful in elections. The rest is an example where the examiners try to confuse us with too much detail.


13 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Nice blog. Thanks for sharing such great information.Mongo Database Services

    ReplyDelete
  3. Well written article. Get rid of the traditional ways of marketing and buy a customized email list from us. One real-time data can change your entire business for good. Parana Impact provides you the Email List that you are exactly looking for.
    We have worked with many organizations of all the sizes. Our main focus is customer satisfaction. MongoDB Users Email List

    ReplyDelete
  4. Thank you for sharing valid information about software MongoDB



    MongoDB Training in Hyderabad

    ReplyDelete
  5. Thanks for sharing nice information. It was nice to read this Blog.MongoDB Training in Irving

    ReplyDelete
  6. Really nice blog post.provided a helpful information. Big Data Hadoop Online Course

    ReplyDelete
  7. Nice post content is impressive to read ,Thanks for proving some helpful information.Hope you will keep on sharing articles.
    This provides good insight. You might also be interested to know more about generating more leads and getting the right intelligence to engage prospects. Techno Data Group implements new lead gen ideas and strategies for generating more leads and targeting the right leads and accounts.


    TECHNO DATA GROUP

    ReplyDelete
  8. Thanks for sharing this blog. This article gives lot of information.
    Mean Stack Online Training

    Mean Stack Training in Hyderabad

    ReplyDelete
  9. GenexDB makes MongoDB as effective, high quality and agile as possible so you can build effective, high quality applications. We specialize in optimizing your MongoDB database to make use of its powerful capabilities, including schema-less structures, sharding, and replica sets, so that you can deploy highly available and massively scalable database-driven applications.
    https://genexdbs.com/

    ReplyDelete