Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-7333

Add ability to modify document bodies during compaction

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0-beta-2, 2.0
    • Fix Version/s: feature-backlog
    • Component/s: forestdb
    • Security Level: Public
    • Labels:
      None

      Description

      It's trivial to add a callback hook that allows the app to modify a document body as it's being written to the new file during compaction. This has a couple of uses:

      • Schema migration – it's an efficient and atomic way to change the data format of all or many documents.
      • Discarding obsolete data — for example, a doc might store a time series of records, and the older ones could be pruned during the compaction.
      • Removing file offsets — if a doc stores a file offset to an earlier revision of itself (something I'm going to be doing for implementing revision trees) this needs to get removed during compaction since the offset (and the older revision) are no longer valid.

        Activity

        Hide
        jens Jens Alfke added a comment -

        It wasn't necessary for anything we're doing now. It would be important if we were building a multiversion store (like CouchDB / Couchbase Lite) on top of CouchStore. As far as I know we're not doing that yet.

        Show
        jens Jens Alfke added a comment - It wasn't necessary for anything we're doing now. It would be important if we were building a multiversion store (like CouchDB / Couchbase Lite) on top of CouchStore. As far as I know we're not doing that yet.
        Hide
        wayne Wayne Siu added a comment -

        Removing 3.0 from the fix version and assign the ticket to PM for review.

        Show
        wayne Wayne Siu added a comment - Removing 3.0 from the fix version and assign the ticket to PM for review.
        Hide
        cihan Cihan Biyikoglu added a comment -

        Jens, given forestdb is this still relevant?

        Show
        cihan Cihan Biyikoglu added a comment - Jens, given forestdb is this still relevant?
        Hide
        jens Jens Alfke added a comment -

        It would be a useful feature for forestdb. Couchbase Lite could definitely use it, mostly for the 3rd reason I gave: I store offsets of previous revisions in a document, and those offsets become invalid after compaction.

        Show
        jens Jens Alfke added a comment - It would be a useful feature for forestdb. Couchbase Lite could definitely use it, mostly for the 3rd reason I gave: I store offsets of previous revisions in a document, and those offsets become invalid after compaction.
        Hide
        chiyoung Chiyoung Seo added a comment -

        We created a new ticket for ForestDB:

        https://issues.couchbase.com/browse/MB-13815

        Show
        chiyoung Chiyoung Seo added a comment - We created a new ticket for ForestDB: https://issues.couchbase.com/browse/MB-13815

          People

          • Assignee:
            chiyoung Chiyoung Seo
            Reporter:
            jens Jens Alfke
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There is 1 open Gerrit change