Perforce Public Knowledge Base - Depot Setup and Organization
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



Depot Setup and Organization

« Go Back



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.



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.


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 Depotsvs. Single Depot with Multiple Branches
  //dev/...     //depot/dev/...
  //www/...     //depot/www/...
  //doc/...     //depot/doc/...


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:	\\\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:

However, you can specify another drive like this:

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


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:

against the path length of:

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



Was this article helpful?



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

Characters Remaining: 255