Storage / 02

Storage IOPS.

500 × 4 KB records into IndexedDB. Measures write IOPS, sequential read IOPS, then random read IOPS. Cleans up afterwards.

Notes

IDB sits on top of the OS file layer — numbers correlate with disk speed but include database overhead. Useful as a comparative test, not as an absolute disk benchmark.

How it works

We open a fresh IndexedDB store and run three phases. Phase 1: 500 sequential put() calls inside one transaction, timed end-to-end. Phase 2: 500 sequential get(key) calls. Phase 3: 500 get(random key) calls. Each phase reports operations per second.

Final cleanup clears every record. The store remains (empty); IDB doesn't expose drop, so subsequent runs use the same empty store.

Frequently asked

What are IOPS?

I/O operations per second. A single operation is one read or write of one record. Higher = faster storage. Modern NVMe SSDs hit 100k+ random read IOPS natively; through IDB you typically see 5k-50k because of database overhead.

Why test through IndexedDB?

It's the only persistent storage API the browser exposes with measurable per-record access. The OFFICIAL File System Access API would be more direct, but it requires explicit user permission per file. IDB is permission-free and good enough for relative-storage benchmarking.

What's the difference between sequential and random read?

Sequential = reading record 0, then 1, then 2, in order. Random = reading 47, then 12, then 308. On a true SSD they should be similar; on a spinning HDD or eMMC, random can be 10-100× slower. The gap reveals the storage technology under the hood.

Why does my SSD show only 2000 IOPS?

IndexedDB carries significant overhead: serialisation, transaction management, JS-to-storage marshalling. Native NVMe might do 100k IOPS, but through IDB you see 5-20k. That's normal. The test is good for comparing this device to other devices using the same test, not for absolute disk benchmarks.

Will running this fill my storage?

No — we use 4 KB × 500 records = 2 MB total, and clean up afterwards. The test leaves no residue.