Skip to content

Explore using OPFS as an attachment store instead of idv/indexeddb blobs #9173

@janl

Description

@janl

Idea via @SourceR85 in #9167 (comment)

OPFS Link

Things to consider:

  • How can we ensure transactionality between two different data stores?
  • IndexedDB transactions auto-commit on the end of the runloop, so we cannot do asynchronous tasks inside an IndexedDB transaction
  • OPFS has a synchronous file access API, but that is only available in a worker for not-blocking-the-main-thread reasons
  • A possible solution could write the attachments first and then start the IndexedDB transaction, but if the transaction fails, we might leave unreferenced attachments in OPFS that do not show up in IndexedDB. For that we would need a cleanup task that is not too expensive, so we can run it during compaction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions