Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@andreitokar
Copy link
Contributor

This PR is an attempt to move all persistence-related code out of MVStore class into FileStore and more clearly define interface between the two without exposing details of Filestore implementation.
This would allow for swappable alternative FileStore specializations, i.e. multi-file one, or one which would not hold all chunks in memory.
It has non-functional stub for multi-file store, because that part is still work in progress.

@grandinj
Copy link
Contributor

Are you sure about this?
() MVStore already beats the multi-file type solutions
(
) If you are running something that needs very large DBs, then there is absolutely no point at all in attempting to run in a small memory space.

@andreitokar
Copy link
Contributor Author

@grandinj Of course, I am not sure, at least not until it's done and tested.

MVStore already beats the multi-file type solutions

Multi-file itself does not mean better or worse, faster or slower. Mutlti-file it's just efficient way to roll disk space. If file systems would provide trimming from the beginning of the file, we won't need multiple. And I am pretty sure that append-only is the most efficient writes possible. so I expect it to be more performant. Hopefully it'll be better in regards to disk space utilization.

If you are running something that needs very large DBs, then there is absolutely no point at all in attempting to run in a small memory space.

This is unrelated issue, subject to debate. This PR is just giving us opportunity to develop pluggable alternative FileStore implementations, that's all it is.

@katzyn
Copy link
Contributor

katzyn commented Sep 16, 2022

I like single-file approach, but for space compaction and defragmentation we need to rewrite everything and it is reasonable to use a separate file for it. If we have versions 1–100 in a file-1 and only few of them are currently used, online compaction will require creation of a new file-2 with only used versions in it and reordered data, but during this procedure we need a file-3 to store new versions 101… (modified data only) in it. After compaction file-1 can be removed and we'll have files 2 and 3. During the next compaction we can combine alive versions from 2 and 3 into new file-4 and use new file-5 for the new versions and so on. Offline defragmentation can combine all files into one, it doesn't need an additional file for parallel transactions. (It's just an idea.)


Copyright years in AppendOnlyMultiFileStore and SingleFileStore need to be updated.

@grandinj
Copy link
Contributor

Is LIFT more trouble than it is worth, should I disable it?

@andreitokar
Copy link
Contributor Author

Looks like it. but let's leave it on for a little while, and disable on case-by-case basis for now.

@andreitokar andreitokar merged commit 1053419 into h2database:master Sep 23, 2022
@katzyn katzyn mentioned this pull request Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants