Skip to content

Commit

Permalink
Another small fix for slow writes question.
Browse files Browse the repository at this point in the history
  • Loading branch information
manishrjain committed Jul 17, 2018
1 parent d29feab commit 44f0e25
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,11 +583,11 @@ There are multiple workarounds during iteration:

- **My writes are really slow. Why?**

Are you creating a new transaction for every single key update? This will lead
to very low throughput. To get best write performance, batch up multiple writes
inside a transaction using single `DB.Update()` call. You could also have
multiple such `DB.Update()` calls being made concurrently from multiple
goroutines.
Are you creating a new transaction for every single key update, and waiting for
it to `Commit` fully before creating a new one? This will lead to very low
throughput. To get best write performance, batch up multiple writes inside a
transaction using single `DB.Update()` call. You could also have multiple such
`DB.Update()` calls being made concurrently from multiple goroutines.

The way to achieve the highest write throughput via Badger, is to do serial
writes and use callbacks in `txn.Commit`, like so:
Expand Down

0 comments on commit 44f0e25

Please sign in to comment.