-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add a run-time start-up switch -s/--store-backend to choose the data store backend #251
Conversation
store backend. Right now there is no detection of the format of an already made repo. We should also add that, lest a change in a config "hide" data.
Nice work! I'll try it out with a local build in a little while. |
can you please add 3rd variant - "ram" that just assigns "localStore = cache"? it will useful for benchmarking the network part, without the slowdown caused by the disk storage. please note that later you will have to add commit for README since it documents all switches |
I think this is a great idea (I did a RAM fs on Linux myself), but should probably be a new DataStore fork maybe with just a Nim |
For me, SQLite backend is still the best choice since it doesn't use too many files and the SQLite engine ensures and can check the integrity of DB. I feel it is a bit more reliable. Also, FS backend has a small problem on Windows (#237). For me, 20-30% performance loss (with large SQLite pagesize) is manageable for the initial production version. In the long term, we may explore other DB engines, but first we need to establish requirements for the blockstore (i.e. implement other scenarios of its use, in particular usage quotas #159). |
@c-blake no, just "localStore = cache" will do it. The CacheStore by itself implements the BlockStore API. |
you just need to add 3rd case:
|
This Linux has It sounds like we will still would want this CLI parameter (as well as a |
|
Trade-offs. More set-up (|not if the expert user has it ready to go - on Linux I pushed commit, but I feel at least 1 other person should vote before I update the README with the new option and its valid values. Or |
Thanks @c-blake, I'll abstain from merging this right now, but will integrate it with my work on repo limits. The reason is that there might be changes around the current stores that might affect this. Overall, great work tho! |
I think this flag is still useful for experimentation purposes and we could expose either the FS datastore or the SQLite datastore, this would helping this backends. |
Well, mostly I did not create a new branch for those commits out of an excess of optimism, but rather did them on my main fork. I was just cleaning up that old fork and making a new one to add backports & units stuff and other new client things. I can / will revive the patch and PR here under a more clean git setup later and link back here which may help as we do more work on data store things. It probably needs re-basing care anyway. (I actually was not sure how all that was going to show up in github until I actually did it.. I was aware there are ways to move commits to a branch, but wasn't confident that would all have worked out..) |
A) renaming to --repo-kind which makes more sense in the current code and B) without a working cacheStore (yet) Tagging related codex-storage#357
A) renaming to --repo-kind which makes more sense in the current code and B) without a working cacheStore (yet) Tagging related #357
With current default chunk sizes, a
d:release
build & big upload, SQLite uses 20% more space & 30% more time than files on a Linux tmpfs/Intel. So, SQLite may not be the hoped for performance win (and there may be other workloads where the perf delta is much worse).More generally, different host devices/FSes will always have different ideal back-ends. So, some kind of choice makes baseline sense. (Indeed, any user choice raises the idea of a translation engine to re-format a repo (FS <-> SQLite) when re-hosting to a new device, but that is unlikely to be a near term concern.)
If the idea of a DataStore is switching backends behind its abstraction, this also lets us exercise said switchability. It also lets us more easily test any "above DataStore" quota abstraction -- e.g., some generic pre-space-allocating solution with multiple backends.
(I realize this needs some hook into our testing framework which I am still figuring out, but I wanted to start the PR for any design feedback.)
EDIT: Related #179 and #160 (review)