3 ms·
Granted that the DOM event API feels clunky, but I actually think they got things mostly right: - low-level storage primitive with support for indices, "you pa
by bwindels 5y ago
Granted that the DOM event API feels clunky, but I actually think they got things mostly right:
- low-level storage primitive with support for indices, "you pay only for what you use".
- very fast if used in the right way
- very large sizes supported
- built-in version support, making it easy to do schema and data migrations.
- basic query api that again gives you a lot of flexibility and control over performance
- can be abstracted away by higher level libraries like Dexie
I've built a web-app heavily relying on IDB, and storage operations are generally much faster than the native app on Android using Realm DB. IDB is backed by leveldb on Chrome, which in benchmarks is consistently faster than sqlite. I'm happy we didn't end up with websql for one.
My biggest gripes are:
- The incompatibility with ES6 promises early on (but IE11 still suffers from) was unfortunate.
- The auto-commit behaviour of transactions is somewhat annoying and usually has an impact on your architecture if you want to write multiple things in one transaction, but it would have been easy to have memory leaks and deadlocks without this.
- Quota management and eviction is wildly inconsistent between browsers, even on Chrome you get evicted when storage gets critically low.
- Safari has a history of pretty bad IDB bugs.