Depot setup and organization

Single or multiple depots?

Info & Tags

Article #:
684
Created:
03/14/07
Modified:
05/26/08

Links

  1. Technote #20
    Multiple projects in Perforce
  2. Technote #77
    Planning your Perforce Server installation

SUMMARY


Whether to set up one depot with many top-level directories, or many separate depots is really a matter of preference. In most respects, the two are functionally equivalent, as noted in KB Article #20: Setting up Multiple Projects in Perforce

This article details some of the minor differences between Perforce Servers with single and multiple depots.

DETAILS

Views

The single depot setup requires slightly less maintenance and will produce a simpler default workspace View.

For example, when you create a new workspace in Perforce, the default view is:

  //depot/... //workspacename/...

However, for a Perforce Server with multiple depots, the default workspace view is:

  //depot1/... //workspacename/depot1/...
  //depot2/... //workspacename/depot2/...
  //depot3/... //workspacename/depot3/...

In either case, users will need to modify their workspace view to map whatever parts of the depot(s) they need. The complexity of your client view will largely be the same whichever setup you use.

Users of a single depot setup will generally have to do less initial editing of their workspaces, but after that, there is little difference.


Compartmentalization


Multiple depots tend to make most sense when you are looking for additional comparmentalization at the highest level. For example, to separate application development from web development, or separate documentation from development.

Note that you can still maintain this separation with a single depot, it is just pushed down a level.  For example:

  //depot/dev/...    vs.  //dev/...
  //depot/www/...  vs.  //www/...
  //depot/doc/...     vs.  //doc/...


Backup


A depot is simply a privileged top-level directory in your Perforce Server Root location ($P4ROOT) where archive files are stored. For maintenance, having a single depot necessitates backing up only a single directory tree, for example:
 
  $P4ROOT/depot

By contrast, having multiple depots requires explicitly backing up all of the depot directory trees in $P4ROOT, for example:

  $P4ROOT/depot1
  $P4ROOT/depot2
  $P4ROOT/depot3

Again, there is otherwise no functional difference between the single and multiple depot setup. Anything that can be done with multiple depots can be done with a single depot.

Nonetheless, a number of customers prefer to have multiple depots, particularly when they are looking for high-level visibility and separation of independent projects or organizational functions.

Disk Space

Another benefit of using multiple depots is the ability to put different depots on different file systems or hard drives. This is especially useful if disk space is a concern on the $P4ROOT drive. In the Map field of the depot spec, you can specify another drive to store that depot's file archives. For example, the default depot map looks like this:

Map:    depot/...

However, you can specify another drive like this:

Map:   d:\perforce\newdepot

Please note that server performance might be affected if you use a network drive rather than a local drive to store your archive files.