You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current IDBFS only provide file persistence and it loads all file into memory at once. It'll be great if the new FS could load into memory by demand.
Yes, the way I envision this working is that the IDB backend itself would always load data on-demand and a separately configured caching layer would improve performance by keeping a limited amount of data in memory.
I've written a design doc for how a WasmFS IndexedDB backend might work, but no implementation work has started on it. So far we've been prioritizing work on the OPFS backend to get it to be stable and fast. Even with a better IndexedDB backend design, OPFS with SyncAccessHandles will still be much faster than IndexedDB. Do you have a use case for IndexedDB that couldn't use OPFS?
I have a use case for IndexedDB backend. I need to save some user modifications between browser sessions in a document editing app. Currently it's done via custom FS backend + Emscripten async IndexedDB API (emscripten_idb_async_delete() and such). This custom implementation has some bugs but works well in most cases.
I think it's important that we have a fallback to SyncAccessHandles when they are not available. I believe IndexedDb is the only viable one because it doesn't have storage limitations - but I could be wrong?
There is also the fact that sync also only works in web workers, and there are other places, like extensions, where it would be great to have persistent storage!
The latest thinking here is that it would be good to provide a bridge between WasmFS and the legacy file system backends, including IDBFS, rather than implementing a new WasmFS IndexedDB backend from scratch (although that would certainly still be possible and would have better performance). Unfortunately no concrete work is planned for this, though.
Activity
junyuecao commentedon Mar 6, 2022
The current IDBFS only provide file persistence and it loads all file into memory at once. It'll be great if the new FS could load into memory by demand.
tlively commentedon Mar 7, 2022
Yes, the way I envision this working is that the IDB backend itself would always load data on-demand and a separately configured caching layer would improve performance by keeping a limited amount of data in memory.
junyuecao commentedon Oct 26, 2022
@tlively May I ask for the current status of IDB backend or what is the plan?
tlively commentedon Oct 31, 2022
I've written a design doc for how a WasmFS IndexedDB backend might work, but no implementation work has started on it. So far we've been prioritizing work on the OPFS backend to get it to be stable and fast. Even with a better IndexedDB backend design, OPFS with SyncAccessHandles will still be much faster than IndexedDB. Do you have a use case for IndexedDB that couldn't use OPFS?
mere-human commentedon Nov 1, 2022
I have a use case for IndexedDB backend. I need to save some user modifications between browser sessions in a document editing app. Currently it's done via custom FS backend + Emscripten async IndexedDB API (
emscripten_idb_async_delete()and such). This custom implementation has some bugs but works well in most cases.maccman commentedon Dec 12, 2022
I think it's important that we have a fallback to SyncAccessHandles when they are not available. I believe IndexedDb is the only viable one because it doesn't have storage limitations - but I could be wrong?
AntonOfTheWoods commentedon Aug 17, 2023
There is also the fact that
syncalso only works in web workers, and there are other places, like extensions, where it would be great to have persistent storage!defundinformants commentedon Sep 25, 2023
tlively commentedon Oct 5, 2023
The latest thinking here is that it would be good to provide a bridge between WasmFS and the legacy file system backends, including IDBFS, rather than implementing a new WasmFS IndexedDB backend from scratch (although that would certainly still be possible and would have better performance). Unfortunately no concrete work is planned for this, though.
mere-human commentedon Nov 12, 2023
@tlively Is there a GitHub issue where this work could be tracked?
tlively commentedon Nov 27, 2023
@mere-human the issue for this is #18935.