Intent to Implement: IndexedDB relaxed durability transactions

133 views
Skip to first unread message

Adrienne Walker

unread,
Sep 3, 2019, 2:32:37 PM9/3/19
to blink-dev

Contact emails

en...@chromium.org


Spec change discussion

https://github.com/w3c/IndexedDB/issues/50


Summary

Exposes an optional relaxedDurability parameter on IDBDatabase.transaction to control flushing to disk.


Motivation

Allow developers to explicitly trade off durability for performance.

Currently after writing an IndexedDB transaction, Firefox does not flush to disk but Chrome does. This flush increases the durability (in the ACID sense) in that it will be guaranteed to have been written all the way to disk rather than merely to an intermediate OS cache. However, this comes with a significant performance cost. On one test benchmark, not flushing caused a 10X+ performance improvement in adding new objects to a database.


There is a future hope that we can make the relaxedDurability=true the default instead of opt-in.


Risks

Interoperability and Compatibility

Code using relaxedDurability will still run correctly on browsers that don't implement this feature, with degraded performance.


Ergonomics

There are no known risks associated with ergonomics.


Activation

This feature will be easy for developers to take advantage of immediately.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Link to entry on the feature dashboard

https://chromestatus.com/feature/5730701489995776


Requesting approval to ship?

No.

Andrew Sutherland

unread,
Sep 4, 2019, 11:11:07 PM9/4/19
to blink-dev
Is the API exposure something that can be deferred until after the WG has had an opportunity to discuss this at TPAC?  While the performance benefits sound like a win for blink and it's fine for blink to change its flushing under the hood, Webkit indicated opposition to the API exposure >3.5 years ago and Firefox (via me) indicated opposition a week before this message was sent and there's been no discussion on the issue since.

Andrew

PS: For those interested in further clarification on Firefox's flushing behavior, please see https://github.com/w3c/IndexedDB/issues/50#issuecomment-525474379.

Joshua Bell

unread,
Sep 5, 2019, 12:40:53 PM9/5/19
to Andrew Sutherland, blink-dev
"Intent to Implement" + "Ship: No" means the change is only enabled behind a runtime flag, and is not web-exposed without the flag set.

This is definitely on our list of topics to discuss at TPAC!

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/4cb350f6-846d-4f87-8d2f-3de9ac4aa6b2%40chromium.org.
Reply all
Reply to author
Forward
0 new messages