git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Pluggable backends for refs,wip

From
Ronnie Sahlberg <sahlberg@google.com>
Date
Aug 5, 2014, 21:40 UTC
Message-ID
<CAL=YDWk5C+bQS76_+jx1BSYSxecCxaS95RG181ecbJBLCNWLkQ@mail.gmail.com>
List, Michael,

Please see https://github.com/rsahlberg/git/tree/backend-struct-db-2 for an example of a pluggable backend for refs storage.

This series contain changes to make it possible to add new backends for handling/storage of refs and implements one new backend : refs-be-be.c .

This new backend offloads the actual refs handling to a small database daemon with which ita talks via a very simple rpc protocol. That daemon in turn then connects to the datastore and read/writes the values to it.

By having an always running database daemon it will allow faster startup of the git commands since they will now only need to connect to a domain socket instead of having to traverse a potentially very large number of files during the "build ref cache" phase. Another nice feature is that it can allow running one single database daemon and use it to host the refs for multiple independent git repositoris (by using the new repository name config to distinguish between them).

It can not yet apply to origin/* since it is based on some small series that have yet not arrived there and is still a wip. But if you want to test/look at what we could be doing one day, please feel free to clone this repo.

FAQ: Q: This sound cool. How do I test this?

A: 1, Clone https://github.com/rsahlberg/git/tree/backend-struct-db-2 and build git.

2, gcc refsd-tdb.c -o refsd-tdb -l tdb 3, ./refsd-tdb /tmp/refsd.socket /tmp /tmp/refsd.log

4, git clone --db-repo-name=ROCKet --db-socket=/tmp/refsd.socket <some-repo> foo

./foo should now contain a git repository that store its refs in a separate database. (teh databases are store under /tmp so don't use this for anything important because bad things happens to things stored under /tmp)

regards ronnie sahlberg

Next: Nico Williams
Message 1 of 6 in “Pluggable backends for refs,wip”
  1. Ronnie SahlbergAug 5, 2014
  2. Nico WilliamsAug 5, 2014
  3. Ronnie SahlbergAug 5, 2014
  4. Nico WilliamsAug 5, 2014
  5. Michael HaggertyAug 7, 2014
  6. Ronnie SahlbergAug 8, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.