Save large size file (> 25 GB ) using JavaScript in indexedDB

Viewed 785

I tried to save large file in indexedDB but my chrome is stopped responding when i use files larger than 500MB. My goal is to store 100GB file in indexedDB and also retrieve it back and download the same file.

So basically i need to use indexedDB as Large File Storage.

Please help me to achieve this.

2 Answers

It seems like the limit of the IndexedDB don't allow you to store that amount of data.

If you read through the storage limits it seems the maximum amount of data that can be stored would be 2 GB.

Quoted here would be the following:

There's also another limit called group limit — this is defined as 20% of the global limit, but it has a minimum of 10 MB and a maximum of 2 GB. Each origin is part of a group (group of origins). There's one group for each eTLD+1 domain. For example:

  • mozilla.org — group1, origin1
  • www.mozilla.org — group1, origin2
  • joe.blogs.mozilla.org — group1, origin3
  • firefox.com — group2, origin4

Chrome seems to use other limits, from which you can find more information here

Quoted with the following information

Prior to M66, this was 10% of total storage instead of a fixed value on all devices. Now the minimum of a fixed value (2GB) and 10% is used to limit the reserve on devices with plenty of storage, but scale down for devices with extremely limited storage.

There are limits on the size of the IndexedDB database. It will be calculated based on your available free capacity and the browser your are using, because some browsers use a slightly different metric.

On your case, indexedDB is given memory from the 'TEMPORARY' storage in Google Chrome. The temporary storage on Chrome has a default quota of 50% of the available disk space, 20% of which is available to your offline app. Requesting more quota against temporary storage doesn’t do anything.

Cheers.

Sources of information
[Stackoverflow][1]
[Mozila][2]
Related