Let’s say I call an API to fetch some data from the database, based on certain query parameters, and that API queries the database and gets a large number of results, for example 1 million.
Whats the best way for the client to receive the results, without using pagination (limit/offset) ? I mean from the network stand-point. JSON is slow, and I was wondering if there’s a better alternative. I know browsers can stream videos for example, which are large and have no issues. Could I send the data in some kind of binary format that is faster to put into the client browser memory than JSON ?
Client is Svelte app and doesn’t display all the results, it only displays like 40 at a time, but during scrolling, it displays the next 40 and so on…
If I added pagination on server, then scrolling would be laggy.