[Israel.pm] Reflections on Version Control Systems (VCSes) vs. Databases

Shlomi Fish shlomif at shlomifish.org
Wed Sep 7 10:21:19 PDT 2011


Hi all,

in the last Tel Aviv Perl Mongers meeting, when Sawyer discussed the internal
working of version control systems (= VCSes), he said something that "And don't
worry, a database is not involved anywhere there.", and then I said that I'm
aware of some version control systems that are using databases, and I believe
he said "OK, then I'll know not to use them.".

I'd like to explain why your favourite version control system is most probably
using a database of some sort and why it's perfectly OK.

First of all, what is a database? I recall reading this section from Pratical
mod_perl:

http://modperlbook.org/html/Chapter-17-Databases-Overview.html

There they say that even a simple Perl hash variable (called "dictionaries",
"maps" or "associative arrays" elsewhere) is a database-of-sorts, because it
allows for fast lookup and update of multiple data (= plural of datum), and
there are some on-disk databases such as Berkeley DB, and Tokyo Cabinet that
also implement a simple key/value store for on-disk access. 

Since a version control system need to keep track of more than one datum, it
likely needs to implement some sort of database, either internally or
alternatively make use of one or more database packages. We can think of the
UNIX files/directories tree as a database as well.

And indeed some version control systems have utilised some
not-invented-here databases:

1. Early versions of Subversion used Berkeley DB for its on-disk storage. This
scheme was found to be somewhat inadequate due to some limitations of BDB, and
instead a different FSFS (Filesystem-on-filesystem) built-in database was
implemented. 

2. This FSFS now makes use of SQLite, an on-disk SQL database for doing
something. 

3. The SQLite people have implemented a DVCS called Fossil based on SQLite -
http://fossil-scm.org/ .

4. ClearCase makes use of a database called Raima.

5. The Subversion people used to have a long term of implementing a completely
SQL backend to Subversion.

And like I said, even if a version control system does not make use of a
published database, it probably implemented something of its own.

So there's nothing to worry about here.

Regards,

	Shlomi Fish

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://shlom.in/sussman

Chuck Norris wrote a complete Perl 6 implementation in a day, but then
destroyed all evidence with his bare hands, so no‐one will know his secrets.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


More information about the Perl mailing list