
MongoDB Cookbook - Second Edition
By :

In Chapter 1, Installing and Starting the Server, we saw how to set up a simple replica in Starting multiple instances as part of a replica set and saw what is the purpose of a replica set. We also have a good deal of explanation on what WriteConcern
is in the Appendix of the book and why it is used. What we saw about write concerns is that it offers a minimum level guarantee for a certain write operation. However, with the concept of tags and write concerns, we can define a variety of rules and conditions which must be satisfied before a write operation is deemed successful and a response is sent to the user.
Consider some common use cases such as the following:
Application wants the write operation to be propagated to at least one server in each of its data center. This ensures that in event of a data center shutdown, other data centers will have the data that was written by the application.
If there are no multiple data centers, at least one member of a replica...
Change the font size
Change margin width
Change background colour