Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Durable database writes #99

Closed
wcalderw opened this issue Oct 20, 2016 · 11 comments
Closed

Durable database writes #99

wcalderw opened this issue Oct 20, 2016 · 11 comments
Labels
TPAC 2019 Discuss at Fukuoka

Comments

@wcalderw
Copy link

We need a way to force data writes to disk to prevent loss of data in the event the app/database is "stopped". Firefox has implemented an experimental mode "readwriteflush" that can be used on a transaction such that when oncomplete event happens with success you can be sure that the data made it to the disk. This circumvents the "write cache" that has been implemented in Indexeddb and impacts performance, but for those of use that must ensure data is permanently stored this is a trade off we are willing to have.

As it stands. We have observed Edge Windows 10 1607 (OS level write caching turned off) IndexedDB can take 1 to 15+ minutes before committing a write to disk. We are testing with other systems (Android, IOS, etc) as well, but suspect the same behavior.

@beidson
Copy link

beidson commented Oct 20, 2016

WebKit is certainly not interested in adding any new web APIs that involve synchronous i/o, which is basically what is being asked for here.

Are you actually finding in other implementations that after a transaction commits, there's a 15 minute window where the bits are not written to disk?

That sounds like an issue to raise with those implementations specifically.

@inexorabletash
Copy link
Member

For reference, Chrome does not fire complete until the transaction has flushed to disk. This happens in a different process from the page so does not block any event loops.

@wcalderw
Copy link
Author

We are still investigating other platforms (Android Chromium and IOS WebKit). If chrome is actually generating the complete as suggested then at least that may solve one of the 3 platforms for us. Windows has been a real pain as far as app limitations and short commings... I'll follow up here after we've looked at android.

@inexorabletash
Copy link
Member

@wcalderw - any feedback?

@wcalderw
Copy link
Author

wcalderw commented Jan 14, 2017 via email

@wcalderw
Copy link
Author

wcalderw commented Jan 14, 2017 via email

@inexorabletash
Copy link
Member

For performance reasons, we (Chrome) are considering making the flush optional. Example:

db.transaction(scope, "readwrite", {flush: false});

(Having the default be truthy is annoying, but there's no good antonym. Suggestions?)

Thoughts?

@inexorabletash inexorabletash added the TPAC 2019 Discuss at Fukuoka label Jun 14, 2019
@domenic
Copy link
Contributor

domenic commented Jun 14, 2019

preventFlush: true?

@inexorabletash
Copy link
Member

Maybe. Feels like a double-negative. ref

@domenic
Copy link
Contributor

domenic commented Jun 14, 2019

We've done it a few times, e.g. .focus({ preventScroll: true }).

@inexorabletash
Copy link
Member

I guess this is a dupe of #50 ... let me close it out and move the comments there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TPAC 2019 Discuss at Fukuoka
Projects
None yet
Development

No branches or pull requests

4 participants