Is there a limit on how much JSON can hold?

Viewed 328271

I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit?

Also can any kind of text be sent through JSON. for example sometime I allow users to use html, will this be ok?

9 Answers

JSON is similar to other data formats like XML - if you need to transmit more data, you just send more data. There's no inherent size limitation to the JSON request. Any limitation would be set by the server parsing the request. (For instance, ASP.NET has the "MaxJsonLength" property of the serializer.)

Surely everyone's missed a trick here. The current file size limit of a json file is 18,446,744,073,709,551,616 characters or if you prefer bytes, or even 2^64 bytes if you're looking at 64 bit infrastructures at least.

For all intents, and purposes we can assume it's unlimited as you'll probably have a hard time hitting this issue...

What is the requirement? Are you trying to send a large SQL Table as JSON object? I think it is not practical.

You will consume a large chunk of server resource if you push thru with this. You will also not be able to measure the progress with a progress bar because your App will just wait for the server to reply back which would take ages.

What I recommend to do is to chop the request into batches say first 1000 then request again the next 1000 till you get what you need. This way you could also put a nice progress bar to know the progress as extracting that amount of data could really take too long.

Related