Hacker News new | ask | show | jobs
by tiew9Vii 1871 days ago
If you can chunk the response json-seq/xml (sax parser) may be worth looking at.

The server can incrementally stream a chunk and client incrementally consume a chunk keeping flat memory usage.

I think gRpc also supports streaming but don’t know much on it.

JSON is a bad format for large files as generally you need to read the entire file in to memory before you can use it as you observed.

1 comments

This is the exact problem I have been referring to. Parsing json without loading it entirely is difficult, will look into the xml (sax parser). Can the yaml format be considered for a streaming response approach?