What is the purpose of last step in journaling?

Hi everyone,

I saw the " How MongoDB’s Journaling Works" in this link: How MongoDB's Journaling Works | MongoDB Blog

But i have some questions i don’t understand:

  1. What is the purpose of remapped between shared view and private view in the sentence ?
    " The last step is that mongod remaps the shared view to the private view. This prevents the private view from getting too “dirty” (having too many changes from the shared view it was mapped from)."
    => Can you show me example of this ? as detailed as possible

  2. After shared view remapped to private view in the last step. With the next write operation, the same process still repeat ?
    mongod map to private view → private view write changes to journal log → journal log replay changes into shared view → shared view flush changes to data file with 60s default by OS → shared view remap to private view

Help me,

Thank you so much

Hi @D_i_Nguy_n

Unfortunately that article is waaay outdated as it was published in 2012 :slight_smile: which is 10 years ago as of today.

The method described in that post is for the MMAPv1 storage engine which was removed in recent versions of MongoDB (since version 4.2). MongoDB exclusively uses WiredTiger now, which is a very different storage engine. Notably, WiredTiger allows you to use compression, allows a lot more concurrency, and made possible the inclusion of multi-document transactions, among many. Those are features that MMAPv1 cannot ever add due to its underlying design.

If you are still using MMAPv1, you are using MongoDB versions that is out of support. I would encourage you to migrate to WiredTiger and supported versions.

Best regards

1 Like

Dear kevinadi,

Thanks for your respond, i using mongoDB version 5.0, i thought mongoDB version 5.0 has the same mechanism about journal log and how it work :smiley:

So, can you have some documents describe about how a statement work in mongoDB with WiredStorage engine ? it maybe like a document that i posted above or whatever :grin:

Thank you so much !

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.

Apologies for the delay in responding. The WiredTiger Storage Engine page should explain much of what WiredTiger does at the higher levels. Hopefully you’ll find it useful :slight_smile:

Best regards