REPORT-644 - Improve performance of serialization to disk by writing in a streaming fashion