janl opened a new issue, #9173:
URL: https://github.com/apache/pouchdb/issues/9173

   Idea via @SourceR85 in 
https://github.com/apache/pouchdb/issues/9167#issuecomment-3755310344
   
   [OPFS 
Link](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system)
   
   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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to