|
![]() |
William Brogden wrote:Assuming the server can write the JSON as a HTTPResponse output stream one item at a time - rather than building the whole thing in a buffer and then sending it, any limit will be on the client side, not the server side.
If you are thinking about a browser client that a human being has to interact with, returning more than a few screens worth of data is a very bad design.
Bill
If this is bad design what should be the correct ones?
William Brogden wrote:...
Can the server return any other form besides JSON?
Bill
Bear Bibeault wrote:I don't see how the choice of JSON is any way relevant to the issue; and is, in fact, the interchange format currently in vogue.
The key to large datasets is paging and filtering. As said by many before me: blatting out a ton of data to the user is useless.
Bear Bibeault wrote:I wouldn't suggest not using JSON. Prior to JSON, XML was the flavor of the day. Proprietary formats have their place, but not recommended without really good reasons.
Bear Bibeault wrote:I would not recommend XML unless you have a really good reason.
But yes, allow the user to filter the data to what they want to see; then page the results so that they aren't inundated with a deluge of data.
William Brogden wrote:Why not spit out a CSV file suitable for importing to a spreadsheet program? That would be very compact in transmission and let the spreadsheet do the heavy lifting.
XML would only be indicated if we were dealing with a hierarchical database.
Bill
Bear Bibeault wrote:Most databases, as well as ORMs, will let you specify an offset and limit, which can be use to return just the results for the current "page". Figuring out what these value should be is a simple matter of math.
John Astralidis wrote:
Bear Bibeault wrote:Most databases, as well as ORMs, will let you specify an offset and limit, which can be use to return just the results for the current "page". Figuring out what these value should be is a simple matter of math.
I tried to google it, but I didn't find anything relevant. Perhaps I use wrong keywords. Could you please give me some examples?
Bear Bibeault wrote:
John Astralidis wrote:
Bear Bibeault wrote:Most databases, as well as ORMs, will let you specify an offset and limit, which can be use to return just the results for the current "page". Figuring out what these value should be is a simple matter of math.
I tried to google it, but I didn't find anything relevant. Perhaps I use wrong keywords. Could you please give me some examples?
What database or ORM are you using? The syntax is DB-specific.
Regards,
Radhakrishna
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|