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

Storedb interface / alternate store db backends #10135

Open
roberth opened this issue Mar 3, 2024 · 2 comments
Open

Storedb interface / alternate store db backends #10135

roberth opened this issue Mar 3, 2024 · 2 comments
Labels
feature Feature request or proposal store Issues and pull requests concerning the Nix store

Comments

@roberth
Copy link
Member

roberth commented Mar 3, 2024

Is your feature request related to a problem? Please describe.

SQLite generally does a good job of storing the store object "metadata" (ie everything except the file system object).
However, it's not entirely without issues:

Possibly other issues (please link).

Relevant discussion

Describe the solution you'd like

  • A parameter for nix store init to select a store db backend. Default: sqlite.

  • A store settings file, akin to the binary cache nix-cache-info, but obviously more general.
    E.g. /nix/var/nix/store-settings.json

  • A field in that file, to indicate which store db backend is used.

  • A virtual class StoreDatabase, with implementation for sqlite.

  • LocalStore/LocalFSStore only depend on StoreDatabase.

Describe alternatives you've considered

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added the feature Feature request or proposal label Mar 3, 2024
@roberth roberth changed the title Storedb interface Storedb interface / alternate store db backends Mar 3, 2024
@lf-
Copy link
Member

lf- commented Mar 3, 2024

btw I'm not convinced that 90% of the correctness and scaling problems with the gc process are sqlite. it's likely that nix is misusing transactions, causing the store db to get a broken state. the actual deletion isn't done by a thread pool; it needs to be. and several other related things.

but determining whether the database is the problem should be empirically done first before simply trying to switch it out one for one.

@roberth
Copy link
Member Author

roberth commented Mar 3, 2024

This solution isn't meant to only solve that one particular issue; see network and security use cases in description.

Improvements to the GC are more than welcome. Best to discuss that in a separate issue or on matrix.

@roberth roberth added the store Issues and pull requests concerning the Nix store label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal store Issues and pull requests concerning the Nix store
Projects
None yet
Development

No branches or pull requests

2 participants