Data Storage in MongoDB

64 views
Skip to first unread message

santiago miranda

unread,
Nov 2, 2020, 8:44:33 AM11/2/20
to wiredtiger-users
Hello everyone,

After going thru mongodb docs, I can't quite understand how WT works with mongodb.

I'm just trying to get a high level overview.

The takeovers for me were:

  •  every write op in the db adds up to a snapshot which is held in ram memory
              * if journal is enabled snapshot is "logged" every 1ms
              * journal can refine the recover from a last checkpoint
  • the snapshot is written to disk every minute and now data is durable
               * this produces a checkpoint useful on recovering

Is this more or less the situation?

Any other resource will be welcome, I can't get more from mongo docs this time.

Thanks

Haribabu Kommi

unread,
Nov 4, 2020, 2:46:11 AM11/4/20
to wiredtiger-users
Hi,

On Tuesday, November 3, 2020 at 12:44:33 AM UTC+11 santi...@gmail.com wrote:
Hello everyone,

After going thru mongodb docs, I can't quite understand how WT works with mongodb.

I'm just trying to get a high level overview.

From the following questions, I understand that you want to know how WT is getting used by
MongoDB for disaster recovery scenarios using Journal.

Journal, in other words, is write-ahead log. It is a mechanism of writing the log data first to
disk before the actual data gets written to the disk. For more information, refer the below link.


 
The takeovers for me were:

  •  every write op in the db adds up to a snapshot which is held in ram memory
              * if journal is enabled snapshot is "logged" every 1ms

If the MongoDB starts with journal enabled, every write operation is logged. These logs get
written to the disk under the following conditions.


 
              * journal can refine the recover from a last checkpoint

Recovery is a process of bringing the MongoDB to the point prior to the crash. This can be achieved by restoring the data from the last checkpoint
and applying the journal logs that are applied after the checkpoint.
  
  • the snapshot is written to disk every minute and now data is durable
               * this produces a checkpoint useful on recovering

A checkpoint is a process that is writing all the newly added data to the disk for every minute. This way in case of any problems,
we need to apply the journal logs to a maximum of one minute, so the recovery time of the MongoDB is significantly better.
 
Is this more or less the situation?

Any other resource will be welcome, I can't get more from mongo docs this time.

The following link has useful information about how the WT provides disaster recovery to
MongoDB.


Let us know if you need any more details or clarifications. 

Regards,
Hari
Reply all
Reply to author
Forward
0 new messages