Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use one SVN repository for each website or create sub directorys for each site within a single repository?

I'm currently in the process of setting up SVN on our local development web server and want to know if I should create a repository for each website on the server or a single repository that contains sub-directories for each site?

Thanks for your help.

like image 985
Camsoft Avatar asked Jan 23 '23 18:01

Camsoft


1 Answers

In general I recommend a one project per repository model.

The potential downfall that some people have with this is needing multiple checkouts and sharing code etc.

Using code that's housed within another repository is very simple in svn using the svn:externals keyword. This allows you to pull in a directory from another repository into any given directory of your repository.

The gains you get with multiple repositories are multiple.

  • SVN in particular slows down when working on a large checkout. All the normal commands will take noticeably longer in a very large checkout.

  • If you start sharing work with other developers maintenance costs can increase as you may need to lock them out of some 'project directories' while giving them access to others.

  • If you ever sell off a portion of your work, the buyer may request the source history. Splitting a large SVN repository is a very tedious effort, and in some cases may prove untenable.

  • Simplicity. Multiple repositories can give you a very clear guideline on how to split up your code. This results in cleaner separation if used well, and therefore can act as an extension of your code's encapsulation.

As far as the server costs that was mentioned by Dave, it's very very possible to setup the server in such a fashion that logging into it and running svnadmin create in the right directory is enough to create a new repo.

Personal Experience

Backing up all these thoughts I'll share with you a little bit of my personal experience on the topic.

I'm also known as Kaelten, and I founded WowAce.com. Until recently we ran one of the largest shared svn repositories on the web. It had more than 82k revisions and more than 1.5k projects represented at various points in it's history for more than 3 million lines of code.

Disk space usage is substantial on a repository of this size, the revisions numbers lost meaning since they're all shared across all projects. In the end we had to come up with a system to split it up, chop that giant massive multi gigabyte repo into something small and usable.

In the end it caused me a lot more work to get it working sanely and split up than it did to set up a new system that worked sanely. WowAce.com and CurseForge.com still represent one of the largest selection of repositories of addons for WoW and a few other games, except now they're all split up in a nice sane fashion.

like image 124
Bryan McLemore Avatar answered Feb 02 '23 00:02

Bryan McLemore