views:

67

answers:

2

Hi all,

I'm looking for the database Design ( Relational - Model ) used by Subversion. I'm working in a project that should be able to merge, version and any other similar subversion operations.

Does anyone know any site that describes the Subversion tables ?

Thanks in advance !

+2  A: 

Have a look at this page, which describes the two database formats (Berkeley DB and FSFS).

The Subversion source code contains information on the database in the subversion/libsvn_fs_base/notes folder - there's some history, and a description and diagram of the schema.

You could also view the source code itself. For example, this contains code relating to creating a BDB database:

https://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/fs.c?view=markup

and there's also source code for each table in the database:

https://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_base/bdb/

You can dump the contents of a table in the database:

db4.8_dump YOUR_REPO/db/revisions # or 'changes', or 'locks', or...
Richard Fearn
Hi Richards, actually im looking for how the tables are inside the BerkeleyDB instead of how SVN persist data. If i could study the subversion database design ( Tables and relationships ), could i get some ideas to improve my work.
CHAPa
I've expanded my answer with links to the Subversion source code. There's information about the BDB schema in there.However you should also look into the FSFS format: it was introduced to overcome problems with the BDB format (e.g. FSFS is faster, takes up less disk space, and is less prone to corruption). FSFS is the default format these days.
Richard Fearn
A: 

Not exactly a database answer, but the book Beautiful Code talks about the workings of SVN, which you may find useful.

http://oreilly.com/catalog/9780596510046

Garry