Optimized chunk data writing