In case of process restart or server restart the intermediate data is lost. Could you make use of ```file``` and persist the data?