← Back to release summary

IndexedDB relaxed durability transactions

Category
Offline / Storage
Type
New or changed feature
Status
Enabled by default (Chrome 83)
Intent stage
None

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: https://chromium-review.googlesource.com/c/chromium/src/+/1775557 There is a future hope that we could make the relaxedDurability=true the default instead of opt-in.

Standards & signals

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

View on chromestatus.com