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

feat(core): add sqlite db for nx #26891

Merged
merged 1 commit into from
Aug 21, 2024
Merged

feat(core): add sqlite db for nx #26891

merged 1 commit into from
Aug 21, 2024

Conversation

FrozenPandaz
Copy link
Collaborator

@FrozenPandaz FrozenPandaz commented Jul 10, 2024

Current Behavior

Nx has some persistent storage managed as separate files on disk. For example, the local cache queries the file system for existing directories.

Expected Behavior

Nx has a new more performant persistent storage via SQLite database. The db is used for the following purposes now:

  1. Storing task details of different hashes (This serves as reference for other tables to get more information about a hash)
  2. Storing a record of cached artifacts
  3. Storing a history of tasks which have run

The cache in particular has the following benefits:

  • It's faster, YMMV but it's definitely faster because it writes and reads less from disk.
  • It's able to track access of different cached artifacts
  • It purges cached artifacts more intelligently by looking at when artifacts were last ACCESSED rather than when they were CREATED. This will also eliminate cache misses due to the cached artifacts being purged simply because they were CREATED.

This is opt-in for now, under NX_DB_CACHE=true

Related Issue(s)

Fixes #

Copy link

vercel bot commented Jul 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Aug 21, 2024 5:10pm

@FrozenPandaz FrozenPandaz force-pushed the db-cache branch 17 times, most recently from ac8577f to 2baa5df Compare July 16, 2024 18:48
Copy link

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx [email protected] my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-26891-2baa5df
Release details 📑
Published version 0.0.0-pr-26891-2baa5df
Triggered by @FrozenPandaz
Branch db-cache
Commit 2baa5df
Workflow run 9965155095

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

Copy link

Failed to publish a PR release of this pull request, triggered by @FrozenPandaz.
See the failed workflow run at: https://github.com/nrwl/nx/actions/runs/9977820782

Copy link

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx [email protected] my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-26891-a1d375a
Release details 📑
Published version 0.0.0-pr-26891-a1d375a
Triggered by @FrozenPandaz
Branch db-cache
Commit a1d375a
Workflow run 9977820782

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@FrozenPandaz FrozenPandaz force-pushed the db-cache branch 2 times, most recently from 4022f1f to 1cb1598 Compare July 18, 2024 04:50
Copy link

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx [email protected] my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-26891-1cb1598
Release details 📑
Published version 0.0.0-pr-26891-1cb1598
Triggered by @FrozenPandaz
Branch db-cache
Commit 1cb1598
Workflow run 9985709569

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@FrozenPandaz FrozenPandaz force-pushed the db-cache branch 2 times, most recently from 048ee5a to b4d6144 Compare July 18, 2024 14:21
Copy link

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx [email protected] my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-26891-048ee5a
Release details 📑
Published version 0.0.0-pr-26891-048ee5a
Triggered by @FrozenPandaz
Branch db-cache
Commit 048ee5a
Workflow run 9993019041

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

Copy link

Failed to publish a PR release of this pull request, triggered by @FrozenPandaz.
See the failed workflow run at: https://github.com/nrwl/nx/actions/runs/9993344345

@FrozenPandaz FrozenPandaz self-assigned this Jul 22, 2024
@FrozenPandaz FrozenPandaz force-pushed the db-cache branch 4 times, most recently from dfff093 to a7e4733 Compare August 12, 2024 21:57
Copy link

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx [email protected] my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-26891-a7e4733
Release details 📑
Published version 0.0.0-pr-26891-a7e4733
Triggered by @FrozenPandaz
Branch db-cache
Commit a7e4733
Workflow run 10372914229

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@FrozenPandaz FrozenPandaz force-pushed the db-cache branch 2 times, most recently from e294549 to 0a70597 Compare August 15, 2024 18:42
Copy link

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx [email protected] my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-26891-0a70597
Release details 📑
Published version 0.0.0-pr-26891-0a70597
Triggered by @FrozenPandaz
Branch db-cache
Commit 0a70597
Workflow run 10409362584

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@FrozenPandaz FrozenPandaz force-pushed the db-cache branch 6 times, most recently from 946eab8 to 3bf67cc Compare August 20, 2024 19:40
@Cammisuli Cammisuli marked this pull request as ready for review August 20, 2024 19:40
@Cammisuli Cammisuli requested review from a team and vsavkin as code owners August 20, 2024 19:40
Copy link

🐳 We have a release for that!

This PR has a release associated with it. You can try it out using this command:

npx [email protected] my-workspace

Or just copy this version and use it in your own command:

0.0.0-pr-26891-cf56f7b
Release details 📑
Published version 0.0.0-pr-26891-cf56f7b
Triggered by @Cammisuli
Branch db-cache
Commit cf56f7b
Workflow run 10492552663

To request a new release for this pull request, mention someone from the Nx team or the @nrwl/nx-pipelines-reviewers.

@FrozenPandaz FrozenPandaz merged commit cade5bc into master Aug 21, 2024
5 of 6 checks passed
@FrozenPandaz FrozenPandaz deleted the db-cache branch August 21, 2024 17:12
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants