Hi
How often will MongoDB write to disk.
In MongoDB 3.4 series and earlier, WiredTiger will create a checkpoint every 60 seconds or after 2 GB of journal data (see How frequently does WiredTiger write to disk). However, in MongoDB 3.6 series, this was changed to every 60 seconds only (see SERVER-29210). A checkpoint represents a valid state of the database.
WiredTiger also writes to the journal between checkpoints to help persist data. This is configurable with the j option in WriteConcern.
will it over-write the entire 30 GB with every disk write, or will is only over-write certain parts of the file?
WiredTiger will not overwrite your whole database in every disk write. This will not be performant, and there’s no point rewriting parts of the data that doesn’t change. Every checkpoint will write only as necessary. For example, if the database does not change between checkpoints, nothing will be checkpointed to disk.
Having said that, it’s best if you create a replica set deplyoment in a production environment to provide high availability and ensure your data’s redundancy.
Best regards
Kevin