1

My system requires heavy database writes from thousands of requests per second. In order to minimize response times, I've started to learn about write concerns, and using the unacknowledged / writeconcern 0 will help, however as expected in its "fire and forget" mode, the application will not know if there are any issues. I would like to know if there is a way to monitor or notify if there are any errors. I don't necessarily have to know exactly which writes failed, just the number of failures. The solution doesn't have to be C#, and could run on the database server itself (as opposed to the application server).

My environment is the latest C# driver and latest MongoDb as of Dec 7, running on Ubuntu 14.04. Application server is Windows 2012/IIS8 ASP.NET C#.

Nick
  • 2,735
  • 1
  • 29
  • 36

1 Answers1

0

No. That is the point of setting acknowledge to false. It increases speed but the down side is that you don't get acknowledgement as well as _id if data is inserted successfully. What one can do is fetch data to check.

Example

db.hobbies.insertOne({name: "Dancing"}, {writeConcern: {w: 0}})
db.hobbies.find().pretty()
Community
  • 1
  • 1