Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Subversion physically store its DataBase?

After reading many introductions, starting guides, and documentation on SVN, I still cannot figure out where is my versioning data stored. I mean physically. I have over EDIT [1/2 GB] of code checked in, and the repo is just a few MB large. This is still Voodoo for me. And, as a coder, I don't really believe in Magic.

EDIT : A contributor stated that not all the code was stored in the repo, is that true ? I mean, if I delete my local working copy I still can get back my source code for the repository... If so, I still can't understand how such a compression can occur on my code...

EDIT 2 : When I import the code into repository I have the message "50MB uploaded" and the actual repo is much smaller. Compression Algos must be involved.

BTW, It's funny to read some answers and see how many people DO Indeed believe in Magic, and use SVN without REALLY Knowing what goes on behind the scenes...

like image 740
Mehdi LAMRANI Avatar asked Jan 17 '11 19:01

Mehdi LAMRANI


People also ask

Where does SVN store data?

SVN stores the versioned files in a database, not in the filesystem. So, it's all in there under the db directory. The specific database SVN uses is BerkeleyDB.

How does SVN store data?

Subversion is a centralized system for sharing information. At its core is a repository, which is a central store of data. The repository stores information in the form of a filesystem tree - a typical hierarchy of files and directories.

Does Subversion use a database?

Subversion uses a central database which contains all your version-controlled files with their complete history. This database is referred to as the repository.

Where does the Subversion working copy reside?

A Subversion working copy is an ordinary directory tree on your local system, containing a collection of files. You can edit these files however you wish, and if they're source code files, you can compile your program from them in the usual way.


3 Answers

It depends on what you're using for your Subversion server. I use VisualSVN Server, and it saves the repository files in c:\Repositories.

like image 182
jrummell Avatar answered Oct 28 '22 04:10

jrummell


Putting this as an answer, per Mika's request:

I'm surprised by how many people have this answer wrong. The .svn folder is NOT where the server stores its files (because that is local to the machine - nobody else would be able to check out that information), and, while SVN only stores the diffs (assuming FSFS), it has to store the originals SOMEWHERE.

Of course, as @csharptest.net said: "My guess, 70% is perf data, the other 29.99% is in 'obj' and 'bin' directories. leaving you with the 10mb of actual code checked in." So you're not actually checking in all that information anyway. Most of it never enters the repository. In addition, SVN uses a lot of compression algorithms and various techniques and does not necessarily store your data byte for byte within the repository. That may be why you are seeing a difference in size.

If you're interested in reading more of how SVN works, read about it at this Stackoverflow answer.

Hope that helps!

like image 6
JasCav Avatar answered Oct 28 '22 03:10

JasCav


Your svn repository is stored in a folder in the filesystem, it should contain sub-folders like: conf, dav, db, hooks, locks. These folders make up the repository.

There's an svnadmin tool you can use to manage the repository.

like image 3
Craig Avatar answered Oct 28 '22 03:10

Craig