Version Control Systems – Why Are They Backed with Files?

version control

It seems that more source control systems still use files as the means of storing the version data. Vault and TFS use Sql Server as their data store, which I would think would be better for data consistency as well as speed.

So why is it that SVN, I believe GIT, CVS, etc still use the file system as essentially a database, (I ask this question as we had our SVN server just corrupt itself during a normal commit) instead of using actual database software (MSSQL, Oracle, Postgre, etc)?

EDIT: I think another way of asking my question is "why do VCS developers roll their own structured data storage system instead of using an exisiting one?"

Best Answer

TL;DR: Few version control systems use a database because it isn't necessary.

As a question for a question answer, why wouldn't they? What benefits do "real" database systems offer over a file system in this context?

Consider that revision control is mostly keeping track of a little metadata and a lot of text diffs. Text is not stored in databases more efficiently, and indexability of the contents isn't going to be a factor.

Lets presume that Git (for argument's sake) used a BDB or SQLite DB for its back-end to store data. What would be more reliable about that? Anything that could corrupt simple files can also corrupt the database (since that's also a simple file with a more complex encoding).

From the programmer paradigm of not optimizing unless its necessary, if the revision control system is fast enough and works reliably enough, why change the entire design to use a more complex system?