[SERVER-7981] How insert (write) operations happens in MongoDB. Created: 19/Dec/12  Updated: 09/Jul/16  Resolved: 19/Dec/12

Status: Closed
Project: Core Server
Component/s: Index Maintenance, Sharding, Storage
Affects Version/s: 2.2.0
Fix Version/s: None

Type: Question Priority: Critical - P2
Reporter: Santosh Kumar L Assignee: Unassigned
Resolution: Done Votes: 0
Labels: SERVER_V2, insert, shard, writes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux, ubuntu


Participants:

 Description   

What is the exact sequence of write and read operations in MongoDB?
When we are loading data, which is insert(write) operations, the data will be written to memory or disk???



 Comments   
Comment by Santosh Kumar L [ 20/Dec/12 ]

Thanks Eliot Horowitz for the information.
This link helped me in understanding the inner details better.

Comment by Eliot Horowitz (Inactive) [ 19/Dec/12 ]

Can also read more here:
http://blog.mongodb.org/post/33700094220/how-mongodbs-journaling-works

Comment by Eliot Horowitz (Inactive) [ 19/Dec/12 ]

The order of operations is roughly)
1) applied in memory
2) applied to oplog
3) applied to journal file
4) journal fsynced
5) applied to data files

The relevant get last error params are
w=2 - don't acknowledge write complete till its on a secondary
j=true - don't acknowledge write until its in the journal and fsynced

Generated at Thu Feb 08 03:16:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.