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

オープン
#9,173 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript
領域
databases

調査の方向性

OPFS のリンクと issue #9167 の議論から始めてください。OPFS と IndexedDB 間のトランザクション性、worker 専用の同期アクセス API、コンパクション中の未参照添付ファイルのクリーンアップを調査してください。実行可能なアプローチと、その障害からの復旧動作を文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Idea via @SourceR85 in https://github.com/apache/pouchdb/issues/9167#issuecomment-3755310344

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
主要言語
JavaScript
スター
17.6k
フォーク
1.5k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/pouchdb のほかの issue

apache/pouchdb の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。