Implement value storage in stagedb