Skip to content

Investigate and document the most efficient write pattern for Level DB #13

Closed
@p0mvn

Description

@p0mvn

Background

In #5 , we introduced unsaved additions and unsaved removals in mutable_tree.go. Since the fast index, introduces additional overhead on writes (which is normal for indexes), we would like to ensure that writes are being committed in the most optimal way

Currently, writes to disk work in the following way (in SaveVersion):

  1. unsaved additions get sorted by key, then added to goleveldb batch
  2. unsaved removals get sorted by key, then added to goleveldb batch
  3. goleveldb batch gets written to disk

When we batch operations, goleveldb simply appends them to the batch. Then, on commit, goleveldb batch sequentially applies them. Therefore, the above write pattern might not be the most efficient. We should investigate and document what write pattern would be the most efficient.

Potential alternatives:

  • apply removals first, then additions
  • sort and merge removals with additions and apply them together

Acceptance Criteria

  • investigate and document how leveldb works
  • analyze the proposed alternatives

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions