Intent to Ship: IndexedDB relaxed durability transactions

89 views
Skip to first unread message

Adrienne Walker

unread,
Feb 14, 2020, 6:38:51 PM2/14/20
to blink-dev

Contact emails

en...@chromium.org


Spec change discussion

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


Spec

https://w3c.github.io/IndexedDB/#transaction-durability-hint

https://github.com/w3c/IndexedDB/commit/1a519e7f0a12de4acffc641d3254c1c2d34d380a


Summary

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 the transaction 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.


Mechanically, this change adds a durability hint to IDBTransactionOptions.  If not specified, this hint has the value "default" which tells the user agent to use the default durability behavior.  A developer may now further specify "strict" (current behavior) or "relaxed" (faster new behavior) for this option.


Link to “Intent to Prototype” blink-dev discussion

https://groups.google.com/a/chromium.org/d/msg/blink-dev/aDDJXM8TZnk/xdhSlY-ZDwAJ


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

Yes.


Risks

Interoperability and Compatibility

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


Firefox: No public signals. A position request has been filed (https://github.com/mozilla/standards-positions/issues/254), and the API surface here was co-designed with a Mozillan, but there is no official position.

Edge: No public signals

Safari: Opposed.  Opposed to a previous proposal to make transactions non-durable by default, but no feedback on this proposal.

Web Developers: No signals


Ergonomics

There are no known risks associated with ergonomics.


Activation

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


Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.

https://wpt.fyi/results/IndexedDB/transaction-relaxed-durability.tentative.any.html


Entry on the feature dashboard

https://chromestatus.com/feature/5730701489995776


Boris Zbarsky

unread,
Feb 14, 2020, 8:23:58 PM2/14/20
to Adrienne Walker, blink-dev
On 2/14/20 6:38 PM, Adrienne Walker wrote:
> Firefox: No public signals. A position request has been filed
> (https://github.com/mozilla/standards-positions/issues/254
> <https://github..com/mozilla/standards-positions/issues/254>), and the
> API surface here was co-designed with a Mozillan, but there is no
> official position.

Adrienne,

Thank you; this is very much appreciated!

-Boris

Daniel Bratell

unread,
Feb 20, 2020, 10:08:48 AM2/20/20
to Adrienne Walker, blink-dev

LGTM1

In general it would have been good to have had more vendor buy-in, but it's clear that other vendors don't see this as a prioritized area so I see no need to wait any longer. Especially since the compatibility risk is low (it's only a hint and hopefully it will rarely matter, unless the data is never ever flushed).

/Daniel

--
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/CA%2B1_fV-_S2SdwKAk4jhnjznG-SkS9HwH-uG2hrKsML-JJbzMiQ%40mail.gmail.com.

Chris Harrelson

unread,
Feb 20, 2020, 3:24:35 PM2/20/20
to Daniel Bratell, Adrienne Walker, blink-dev

Yoav Weiss

unread,
Feb 20, 2020, 4:56:19 PM2/20/20
to Chris Harrelson, Daniel Bratell, Adrienne Walker, blink-dev
LGTM3

As Daniel points out, the interop risk here is low as it's defined as a hint.

Reply all
Reply to author
Forward
0 new messages