Skip to content

perf: Optimize transaction write memtable speed #223

@sollhui

Description

@sollhui

(I only read some modules of tonbo, maybe I have some misunderstandings)

I noticed that tonbo can be inserted in two ways, transactional and non transactional:

  1. For non transactional writes:

Memtable may be read and written simultaneously, and using skiplist can effectively balance read and write operations

  1. For transaction writing:

It will first be written in the local BTreeMap to the transaction, and only after the commit is committed and there are no conflicts, will the memtable writing actually take place. In this case:

  • There will be no queries for this transaction.
  • Other transactions will not read the memtable of this transaction because I noticed it was a snapshot read.

So, for this situation, there is no need to use a balanced read-write data structure, just use an vector for append and sort during flush. Based on my experience, the write performance will be greatly improved.

If the suggestion is beneficial, I would be happy to complete this task because I think tonbo is an interesting project. :)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions