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 writes #23

Closed
amityahav opened this issue Aug 18, 2023 · 3 comments
Closed

Batch writes #23

amityahav opened this issue Aug 18, 2023 · 3 comments
Labels
feature new feature of wal

Comments

@amityahav
Copy link
Contributor

it would be nice to support batch writes.
i want to be able to buffer all of my DB modifications that are appended to the WAL during a batch insert and only when the batch insert is completed flush it to the underlying file.

@roseduan
Copy link
Contributor

I have thought about this before, but I need more time to design how to implement it.

@roseduan roseduan added the feature new feature of wal label Aug 19, 2023
@amityahav
Copy link
Contributor Author

this can also optimize batch inserts in rosedb

@roseduan
Copy link
Contributor

Here is my thought:

  1. Add a function named PendingWrites(data []byte)
    • all new data will be maintained in WAL pendingWrites [][]byte
  2. Add a function named WriteAll
    • write all data in pendingWrites
    • update blockNumber and blockSize
    • reset the pendingWrites in wal
    • return all ChunkPosition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature of wal
Projects
None yet
Development

No branches or pull requests

2 participants