Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch rocksdb updates during state recovery #351

Open
daniil-quix opened this issue May 7, 2024 · 1 comment
Open

Batch rocksdb updates during state recovery #351

daniil-quix opened this issue May 7, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@daniil-quix
Copy link
Collaborator

Why?

Currently, when the application recovers from the changelog topic, it writes every state update to the rocksdb.
It's not very efficient and can lead to longer recovery times.

What?

Batch updates to RocksDB during recovery by a number of updates or total bytes in the batch.

Things to keep in mind:

  • Batches should not be too large, otherwise they will take too much memory.
  • Multiple batches can be accumulated simultaneously, one batch per recoverable state partition.
@daniil-quix daniil-quix added the enhancement New feature or request label May 7, 2024
@soumyasankar99
Copy link

Here you can try few things during the implementation of efficient batch updates to RockDB during the recovery process, by considering the above constraints:

  1. Set limits on the number of updates and total bytes per batch to ensure batches are not too large.

  2. Accumulate state updates in memory until the batch size limit is reached, then write the batch to RockDB.

  3. Maintain separate batches for each partition to handle parallel recovery efficiently.

  4. Once a batch reaches its size limit or the recovery is complete for a partition, write the batch to RockDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants