How does Journaling work in MongoDB?

Technology CommunityCategory: MongoDBHow does Journaling work in MongoDB?
VietMX Staff asked 3 years ago

When running with journaling, MongoDB stores and applies write operations in memory and in the on-disk journal before the changes are present in the data files on disk. Writes to the journal are atomic, ensuring the consistency of the on-disk journal files. With journaling enabled, MongoDB creates a journal subdirectory within the directory defined by dbPath, which is /data/db by default.