facebook / facebook/rocksdb

Proposal: Allowing WriteBatch to emulate a memtable

Open
#4,192 3 comments 0 reactions 0 assignees View on GitHub
up-for-grabs
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

### Expected behavior
When we creating a large `WriteBatch`, this WriteBatch can be Wrapped as a memtable.

### Actual behavior
`WriteBatch` is always write to memtable, regardless how large it is. This waste memory and drop down performance.

### Steps to reproduce the behavior
Put 1GB data into a single WriteBatch.

### Further more ( And proposed implementation ... )
1. This trick can also be applied on `WriteBatchWithIndex` to improve MyRocks performance.
1. This **Fake** memtable need some kind of index to WriteBatch's internal data.
1. For multiple ColumnFamily, this trick also works, we just need a shared_ptr on each memtable, let it point to WriteBatch internal data.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.