Perforce Public Knowledge Base - Depot Setup and Organization
Reset Search
 

 

Article

Depot Setup and Organization

« Go Back

Information

 
Problem

Setting 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 the KB Article: Setting up Multiple Projects in Perforce.

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

For information on creating new Perforce depots, please see the Command Reference entry for the p4 depot command.

Solution

Views

The single depot setup requires slightly less maintenance, and produces 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 is largely the same whichever setup you use.

Users of a single depot setup 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 compartmentalization at the highest level, for example, to separate application development from web development, or separate documentation from development.

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

Multiple Depots vs. Single Depot with Multiple Branches
  //dev/...      //depot/dev/...
  //www/...      //depot/www/...
  //doc/...      //depot/doc/...
 
 
 
 
 
 
 
 

Backup

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

By contrast, having multiple depots might require explicitly backing up all of the depot directory trees in or outside $P4ROOT. For example, note these possible locations that might be specified in the Map: field:
Map:	depotA/qa/...
Map:	depot1/...
Map:	\\10.0.0.100\shared\dev/dir/...
Map:	E:\depot1\...

Disk Space

One 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:
depot/... 

However, you can specify another drive like this:
d:/perforce/depot/... 

Note: Server performance might be adversely effected if you use a network drive rather than a local drive to store your archive files.

Performance

In practical terms, there is no performance difference between a single or multiple depot setup. There are only negligible performance differences related to path length.

Multiple depots will create shorter path names. For example, compare the path length of:
//depot/project1/... 

against the path length of:
//project1/...

Shorter paths can yield slight performance improvements because the Perforce Server needs slightly less memory and CPU when comparing shorter paths. See the "Repository Structure Considerations for Performance" white paper for further information.

Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255