Search code examples
jsonreactjspersistence

Locally store large amounts of data


The main purpose is to store data locally so it can be accessed without internet connection.

In my React application I will need to fetch JSON data (such as images, text and videos) from the internet and display it for a certain amount of time.

To add flexibility, this should work offline as well.

I've read about options such as localStorage and Firebase but all of them so far require either access to the Internet, or are limited to 10Mb which is too low for what I'll need.

  • What would be my best option to persist data in some sort of offline database or file trough react?

  • I'd also be thankful if you could point me to a good tutorial about
    any provided solution.


Solution

  • To store large amounts of data on client side you can use indexedDB.

    IndexedDB is a low-level API for client-side storage of significant amounts of structured data, including files/blobs.

    You can read more about indexedDB api here