/
Local storage can be dangerous

Local storage can be dangerous

If a programmer stores a lot of state in local storage - this a name value pair database within the browser, this can be a poor choice.

The problem is that as the application changes this storage can become a mess - an older version that has an data model different from the current application can leave garbage in which can create hard to detect bugs in newer versions of the code.

It makes it more likely to create problems in the field with customers seeing weird bugs that developers don’t see.

See windows registry for an example of an analogous problem with windows.

At least with local storage the customer can clear localstorage in their browser from a website.

Related content

Cookies are mostly like a bad place to store application state
Cookies are mostly like a bad place to store application state
More like this
Another way to look at why the DOM is a bad place to store state
Another way to look at why the DOM is a bad place to store state
More like this
Do not store application data in the DOM
Do not store application data in the DOM
More like this
Typescript is a bad idea
Typescript is a bad idea
Read with this
The Windows Registry
The Windows Registry
More like this
Javascript object parameter pattern for change resilient Javascript Interfaces
Javascript object parameter pattern for change resilient Javascript Interfaces
Read with this