Skip to content

Use a DB for the metadata #31

Description

@gaborcsardi
No description provided.

Activity

  1. gaborcsardi commented on Dec 13, 2019

    @gaborcsardi
    MemberAuthor

    It seems that SQLite is slow as well, and it also does not play well with having a dependency and C-code free pak in the future, so I gave up on this. I think the best solution will be to write our own serialization, similarly to the qs package.

  2. gaborcsardi commented on Dec 23, 2019

    @gaborcsardi
    MemberAuthor

    RSQLite is not slow, after all: r-dbi/RSQLite#306 :)

  3. gaborcsardi commented on Jan 29, 2020

    @gaborcsardi
    MemberAuthor

    OK, this is not so great, because RSQLite depends on Rcpp and C++ is hard to compile statically, so it is hard to create a static installer. The same applies to the qs package.

    However, the thor package with embedded lmdb seems nice. It is a different approach, because it is just a key-value store, but it is transactional, and that's exactly what we need, even simpler than switching to a SQL DB. We need to serialize the metadata to a raw vector to store it in the DB.

    Also, we don't have to merge the different package sources in the cache, because thor can access all of them within a transaction, and merging them at loading time it quite fast.

  4. gaborcsardi commented on Jan 29, 2020

    @gaborcsardi
    MemberAuthor

    thor/lmdb does not have a timeout for locking, and it is also not interruptible, so if a process keeps a write-lock, then other processes just freeze.

    Probably not a big issue, but we need to be careful to only lock for a short time, and always abort the transaction in on.exit(). Or we can use thor's with_transaction().

  5. gaborcsardi commented on Jan 29, 2020

    @gaborcsardi
    MemberAuthor

    This will be postponed until after the next release.

  6. gaborcsardi commented on Mar 1, 2021

    @gaborcsardi
    MemberAuthor

    Experimenting with embedded sqlite: https://github.com/r-lib/pkgcache/tree/feature/sqlite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions