DEV Community

Discussion on: Does every backend need to be an API?

Collapse
 
jameswagnerjr profile image
James Wagner Jr

Depends on how sensitive you think your users would be to the data potentially seemingly randomly disappearing (Should be a rare occurrence, but more likely then not). If they are sensitive to it, then I would set up an extremely basic REST API to handle it. If they're not, IndexDB is a decent solution. IndexDB functions a lot like localStorage. They both can be cleared if the browser decides it needs that storage for something else. It can also be cleared by the user. The user wouldn't necessarily know that clearing it also clears your app's data.

I'm pretty sure there are libraries for IndexDB to interact with the major frameworks' state management libraries (Storing the stuff inside the state manager in IndexDB).

Thread Thread
 
jasterix profile image
Jasterix

Thank you! i'll check out IndexDB