OT - json file size
Copy link to clipboard
Copied
What do developers think the maximum file size of a json file should be before it starts to slow the interaction process, find, filter, forEach, etc javascript workflow down, or doesnt it matter?
Copy link to clipboard
Copied
I think parsing and string size limits depend on the platform & server environment.
JSON files have a maximum limit of 18,446,744,073,709,551,616 characters. That's Eighteen quintillion, four hundred and forty-six quadrillion, seven hundred and forty four trillion, seventy three billion, seven hundred and nine million, five hundred and fifty one thousand, six hundred and sixteen.
Copy link to clipboard
Copied
Thanks for that, I'd still be interested to know in terms of max kbs/mbs what the json file size should be. I could be wrong but I would have thought the more lines of text in it the more time it would take to process a request. Just trying to figure out if there is any suggested max-size before things start slowing down.
Copy link to clipboard
Copied
This is an old study, but it should be an indication:
How Big is TOO BIG for JSON? - Josh Zeigler
Copy link to clipboard
Copied
Thanks Ben,
I guess in my case it would be imaterial as l only have about 150 products to deal with. Although each object would contain much more text than the example object tested it still should not effect the efficiency.
My initial thoughts were to break up the information in different api calls but if l can bring it all back in one json file without loss of speed when querying it l would prefer that. Once l get 25 percentage of the information into the database l can bring it back as a json file and see how large that is in kbs then times it by 4 and check the size of the file against the listed examples.
Thanks for your input and the link.
Copy link to clipboard
Copied
I never thought in terms of size limitation (and it is an excellent question that you raised there), but for information, that made years that I function thus, that is to say call with a data base (INNER JOIN obliges... massive DATAS back) and global return of the information in the form of JSON, then in order to avoid the requests inter pages, I store directly JSON in the localstorage (PWA obliges) and that functions marvelously...
judicious choice that you made there, 😉
Copy link to clipboard
Copied
Thanks Birnou,
Storing the data in local storage is an interesting approach if you need to access it again through out the website.
Hopefully the size of the json file returned from my database should be well within acceptable levels. l was just being over cautious as l wouldn't want to compromise on performance.

