Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What database does Subversion use?

What database does Subversion use?

Is there a default or can you set it up to use any DB?

like image 592
Albert Muniz Avatar asked Jan 21 '14 21:01

Albert Muniz


1 Answers

Server

Subversion supports two back ends at current for storing repositories. You can choose which with the --fs-type option to the svnadmin create command.

  1. FSFS (this is a default) which is a custom format stored with somewhat human readable files (the major exception is that delta data is binary). FSFS also uses a SQLite database for tracking hashes of file content so existing content storage can be reused if identical content needs to be stored again (depuplication). If you're thinking of a typical relational database, the SQLite usage in FSFS is the closest it gets and the SQLite db doesn't actually store any data and can be deleted with no data loss at any time (consequence is future revisions might take up more space). FSFS has had significant amounts of work done on it to optimize it for a variety of situations and has grown a number of knobs to be able to make it optimal even for unusual situations.

  2. BDB (this is the original back end) which uses the Berkeley DB to store the repository. As of 1.8.0 this back end is deprecated but still supported. It has not had a lot of work done to it in a long time and FSFS will outperform it in almost all cases.

There has been at least one other back end implementation by Google, which was never released using Google's proprietary BigTable storage. I believe this is actually still used for GoogleCode's Subversion support.

Subversion 1.9.0 (not released at the time of this writing) will support a new experimental storage called FSX (pronounced like physics) which will be much more compact and faster than FSFS. It's expected that once FSX is considered stable that BDB will be removed entirely.

Subversion does not support using other general purpose databases like MySQL, PostgreSQL, Oracle and others (RDBMS or NOSQL) for storing all the content at all and there are no plans to support them at this point.

Client

For the client side working copy the Subversion client has used two different formats

  1. WCv1 (doesn't exactly have a name but that's what we've taken to calling it now) which used flat files in a .svn directory under every directory of the working copy. This was used by Subversion up until 1.7.0 when we changed to WC-NG.

  2. WC-NG which uses a SQLite database in the .svn directory at the top level of the working copy. This is used by Subversion since 1.7.0.

like image 170
Ben Reser Avatar answered Oct 19 '22 18:10

Ben Reser