concept · Storage

Write Integrity Test

Fire hundreds of concurrent IndexedDB write transactions, then read every record back and verify none were dropped. These are exactly the scenarios the SQLite backend is engineered to handle — atomic commits, concurrent writers, no torn writes.

Written
Verified
Missing
Duration
idle
Each run opens a fresh database, writes all records in parallel batches (simulating multiple tabs or workers writing concurrently), then reads every key back. A result of 0 missing demonstrates the atomicity and isolation guarantees that SQLite's WAL mode provides — every committed transaction either lands completely or not at all.

the pattern

// Open database with an object store const db = await openDB('integrity-test'); // Write records in concurrent batches const batches = chunk(records, batchSize); await Promise.all(batches.map(batch => writeBatch(db, batch))); // Read them all back and verify const allKeys = await getAllKeys(db); const missing = expectedKeys.filter(k => !allKeys.has(k)); // SQLite backend: missing.length === 0

see also