2

I am new in mongodb and i want to know How mongodb handels users requests. What happened if the multiple users fire the multiple insert commands or read commands at the same time. 2:-When or where Snapshot coming in to the picture.(Which phase).

Cœur
  • 37,241
  • 25
  • 195
  • 267
moh12
  • 55
  • 9

2 Answers2

2

Multiple Inserts and Multiple Reads

MongoDB allows multiple clients to read and write the same data. In order to ensure consistency, it uses locking and other concurrency control measures to prevent multiple clients from modifying the same piece of data simultaneously

Read this documentation it will give you complete info about concurrency concurrency reference

MongoDB allows very fast writes and updates by default. The tradeoff is that you are not explicitly notified of failures.By default most drivers do asynchronous, ‘unsafe’ writes - this means that the driver does not return an error directly, similar to INSERT DELAYED with MySQL. If you want to know if something succeeded, you have to manually check for errors using getLastError.

MongoDB doesn't offer durability if you use the default configuration. It writes once every minute data to the disk. This can be configured using j Option and Write Concern on the insert query. write-concern reference

Snapshot

The $snapshot operator prevents the cursor from returning a document more than once because an intervening write operation results in a move of the document.

Even in snapshot mode, objects inserted or deleted during the lifetime of the cursor may or may not be returned. snapshot reference

References: here and here

Hope it Helps!!

Community
  • 1
  • 1
Clement Amarnath
  • 5,301
  • 1
  • 21
  • 34
0

I am asking that question in the context of journaling in mongodb. As per the mongodb documentation. A write operation first come into the private view.So the Quetion is if multiple write operation have been performed at the same time,than multiple private view will be created...

2;-Checkpoints and snapshot:in the journaling process which point of place snapshot of data is available..?

moh12
  • 55
  • 9