MongoDB Journal

MongoDB Journal

Journal

https://docs.mongodb.com/manual/core/journaling/

durability - MongoDB 使用write ahead logging - journal files

WiredTiger 使用checkpoint , eg 如果db宕机,db可以从last checkopoint 恢复数据。

journaling: 每个client 进来的write operation,会有journal record。

WiredTiger to use in-memory buffering for storing the journal records.

Sync disk:

  • replica member通过oplog sync 数据; 定时(每100 ms)etc...
  • write operation ,指定参数 j:true

Journal file format: WiredTigerLog.<sequence> where <sequence> is a zero-padded number starting from 0000000001.

Journal file 有大小限制, 每个大约是100MB,如果超过,创建新的journal 文件并且会remove old journal file