When adding/deleting multiple documents to/from the db, save the
database on disk after each modification, and not at the end of the batch.