TODO: writing to external storage and flush initial data from zlog