Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-5939

Deletions Equal the Same Amount of Data as Inserts

      I'm running into issues with replication lag due to low IOPS (which can't change in my use case) so I'm analysis my data ingest algorithm to try and limit the number and size of operation in the OpLog.

      According to the documentation here: http://docs.mongodb.org/manual/core/replica-set-oplog/#deletions-equal-the-same-amount-of-data-as-inserts. Which states: "If you delete roughly the same amount of data as you insert, the database will not grow significantly in disk use, but the size of the operation log can be quite large." I interrupt that statement to mean that deletions can use as much oplog space as inserts. However, when I run a test and watch the oplog, a deletion in the oplog is only a instruction to remove the _id from the collection. I'm not sure how this is comparable to an insert which could be up to a 16MB document.

      Yes I'm aware that removing multiple documents in 1 command can produce multiple oplog entries but that should be covered in http://docs.mongodb.org/manual/core/replica-set-oplog/#updates-to-multiple-documents-at-once : "The oplog must translate multi-updates into individual operations in order to maintain idempotency. This can use a great deal of oplog space without a corresponding increase in data size or disk use."

      Please let me know if i'm missing something in my test or if the documentation needs to be updated.

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            AndrewDoumaux Andrew Doumaux
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 24 weeks ago