Subversion - One Repo Per Project or One Project Per Repo?

Bookmark and Share

I’m curious how others have setup their repositories:

  1. One repository per project or…
  2. One project per repository

The Subversion book goes into this a bit - and mentions a few pros and cons of each method but I was curious what people were actually doing.

Right now we are ‘One project per repository’.  There were a few reasons for making that decision but now we are re-evaluating and considering moving to a single repository for everything. I’m curious if anyone is currently doing that and having issues?  Anyone have an alternate setup?

Possibly Related:


13 Responses to “Subversion - One Repo Per Project or One Project Per Repo?”

dominick on July 17th, 2008 2:37 pm:

just posted my thoughts on the subject here:
http://www.newviewnetworks.com.....ient/?p=51


Jason Dean on July 17th, 2008 2:58 pm:

Jim, Would you mind briefly explaining the difference? Right now I am using One Project per Repository. But i am haivng a hard time visualizing that one Repo per project would be.


Jim on July 17th, 2008 3:05 pm:

Basically I have:

Project 1
- Trunk
- Branch
- Tag
Project 2
Project 3

vs.

Repo
- Project 1
- Trunk
- Branch
- Tag
- Project 2
- Project 3


Jim on July 17th, 2008 3:06 pm:

@dominick - Good blog post. In our instance - all our projects are for one client.


dominick on July 17th, 2008 3:12 pm:

then in your case, I would stick to one repository unless a certain project was so large in scope that it deserved it’s own repository. In other words, can the current project setup handle it or will it require a completely different project management pipeline. Remember that currently branches can be moved only within a repository. So if you do decide to create a separate repository for a client, you will not be able to move code around and maintain their revisions. So any shared code you use for that project would branch. One other consideration is space, but that’s not so much of a problem these days.


Rob Wilkerson on July 17th, 2008 3:45 pm:

I’ve used both and have liked somethings about both, but I’m now using 1 repo, multiple projects. What I like about my current configuration is the reduced maintenance (1 set of hook scripts, 1 set of perms, etc.). What I don’t like is that, for any given project, the revision numbers are sequential.


TomdeMan on July 17th, 2008 3:56 pm:

I had to research this a while back. I was working for a company that had giant repositories, with a number of projects. It was painful to do an update, and almost impossible to pull logs.

Since SVN is a form of file system it reacts like most do. The larger the file system gets performance starts to degrade. That’s where partitioning saves the day.

There are some out there that can pull it off, like the apache repo, but you know they have dedicated a good amount of resources to the machines serving that repo. So if you want performance and don’t have a beefy infrastructure, then go with a repository for each project.

Keep in mind, that you can always link / embed other repositories with the SVN EXTERNALS property.


Rob Gonda on July 17th, 2008 4:33 pm:

You’ll be insane to have all your projects in a single repository. There are many reasons, the two main ones being performance, ability to revert to a revision without affecting other projects. Others could be security, storage space, backup/restore, archiving, etc…


TomdeMan on July 17th, 2008 5:38 pm:

Here’s a link to setting up those EXTERNALS.

http://tomdeman.com/blog/2007/.....ur-Project

It builds a symbolic link in the actual repo, it doesn’t actually copy one repo into another.

When you checkout, it will checkout from all external repos, as well, so you will have files from all the repos locally to work from.


Jim on July 17th, 2008 9:29 pm:

Thanks for the feedback - keep it coming! I hadn’t thought about performance but it is something to consider - we have over 150 ‘projects’ and some of them are quite big.

And yes, I’m familiar with svn:externals :)


rob on July 18th, 2008 12:55 am:

Seconding what others have said… one repository per-project / plug-in / logical separate area. Branching, tagging, merging and restoring get all weird and non-happy if you just put everything in one repository.


John Farrar on July 18th, 2008 10:03 am:

We have one SVN per project. (This helps us for a number of reasons, but the version numbers make more sense if they are all related to same project!)

I would be more interested in how people are doing trunk, branch and tag directories.


Jim on July 18th, 2008 10:39 am:

@John - yes - I’ve been looking at some of the big open source projects. Mozilla and jQuery for example. It’s interesting to see how they setup their structure…


Leave a Reply

(required)

(required)

Comments for this post will be closed on 18 July 2009.