persistent buffer implementation