3

When using Git to store documents distributed and decentralized it can be considered as a database.

How would the ACID properties and the CAP theorem correspond to git in this case?

I think one has to distinguish between a single repository and the whole network of repositories.

ACID - for a single repository:

  • A would be ok, as there are commits
  • C depends on the use case and thus is not relevant
  • I is the big question,
    • if one is using only one branch that should be fine
    • if one is considering multiple branches I would be fine if a rebase (resp. merge) without conflicts is possible to a master branch (or even all other branches) but is not fine if a rebase would result in a conflict.
  • D depends on your hard disk but should generally be fine

ACID - for a distributed setup:

  • would be the same as above plus, that I has to be seen with respect to all other clones on the network of repositories

CAP:

  • C
    • for a single repository this would be ok
    • looking at a distributed setup this would only be true, if every read operation is preceded by a pull.
  • A this would always be true since the local copy is always available
  • P if a pull is not possible than one has to decide whether to sacrifice A or C (as in the PACELC theorem). Also one can see if the majority of remote repositories is available and use some quorum approach.

(I understand the CAP-C more like the ACID-A, see https://dba.stackexchange.com/a/202125/147543)

Is this a valid interpretation of ACID and CAP as it is used in the database domain? Or is there already an ongoing discussion about Git with regard to ACID and CAP?

4
  • Apples and oranges. Git is a distributed version control system (DVCS) and not an RDBMS. According to Garcia-Molina a database is any permanent data store where the operations of Create Read, Update and Delete can be peformed safely over long periods of time. So, yes, in one sense a Git repo is a DBMS, but not an RDBMS. The terms ACID and CAP don't apply in this case - you're trying to put a square peg into a round hole!
    – Vérace
    Mar 23, 2018 at 18:43
  • 2
    I don't think there is actually a restriction of ACID and CAP to RDBMS. Actually the y are applied to various NoSQL DBMS, thus why not also try to apply it to Git as per your definition from above? Mar 24, 2018 at 12:41
  • I'll grant you it is an interesting way of look at Git, but they are two different tools designed for different tasks and comparing them in this way is, I feel, not appropriate. Many VCS's have database (RDBMS) back-ends (e.g. Bugzilla) - I don't know of anything claiming to be a database that uses Git as a back-end! :-)
    – Vérace
    Mar 24, 2018 at 15:17
  • Actually there is one called Quit, Quads in Git: github.com/AKSW/QuitStore it is a graph database which stores RDF graphs in Git repositories. Mar 24, 2018 at 20:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.