2 min read

We need to kill off the localStorage API

Paul Kinlan

Paul Kinlan

Lead of Chrome DevRel

It is a failure of the web, browser vendors and developers that we are in this situation, but we need to stop advocating for and building examples that use the LocalStorage API's, it is simply not a scalable API and the more we build for it the harder it will be for us to ween ourselves off it.  

LocalStorage has poor querying capabilities, terrible performance, small storage in many browsers, crazily inconsistent eventing and a nasty habit of locking.  It's saving grace is simple semantics and "browser support".

Client-side and offline web-apps are not a reality with localStorage, and if we keep pushing it, we are never going to be in a situation where we have a compelling offline or client-side story.

We need to bite the bullet, move on and start building compelling apps, examples and demos build around IndexedDB, that is our only future (I am still aggrieved that the web dropped WebSQL, it was simple and familiar) and we need to do this by stopping to support localStorage. Period.

To this effect, I have taken the BackboneJS example in TodoMVC (by Addy Osmani) and added IndexedDB support using the Backbone JS adapter by Julien Genestoux. I quickly removed the LocalStorage interface, and in a couple of lines of config change I had IndexedDB support in.

Stay in the loop.

I'm trialing a newsletter. Join for monthly insights into web dev, Chrome, and the open web.

alternate_email

Get in touch

Open to chat about Chrome or Web development.

Book a consultation