The Conifer Systems Blog

Support for More Repository Types

no comments

Currently, as of version 0.2.1, Cascade supports Perforce, Subversion, and Alienbrain repositories.  If you’re using some other software to manage your repository, unfortunately, we don’t have a way for you to use Cascade just yet.  However, we’ve been careful to design Cascade so that we can easily add support for more repository types in the future, so you’re not completely out of luck (please don’t hesitate to contact us if you’re interested).

Let’s step back and look at the architecture of Cascade File System and Cascade Proxy a little bit.  Both are services that run in the background on a PC.  Both receive requests for data from some external source — CFS gets them from the file system layer in the kernel, Cascade Proxy gets them from a network connection.  Both use caching to satisfy those requests more efficiently: once a file is downloaded for the first time, it’s stored in the cache, so we don’t have to download it again on a second request for the same file.  In fact, CFS and Cascade Proxy both share the same “cache manager” implementation, although they make use of it in a somewhat different way.

The Cascade cache manager thinks of files in terms of their URL — for instance, svn-http://svn.collab.net/repos/svn.  This URL encodes all of the information necessary to find the file: what type of repository it lives in, the hostname of the server to connect to, and the path of that file on the server.

When a cache miss happens, the cache manager needs to download the file.  If it is configured with a proxy server, it will forward the request on to the proxy, without regard to what type of repository we are dealing with; the proxy server will take care of everything for us.  If we don’t have a proxy server, it will obtain the file directly from the repository.  To do this, it looks at that first part of the URL and passes the request to one of several “repository query” backends:

  • Requests for URLs beginning with “p4:” will be forwarded to the query_p4 library.
  • Requests for URLs beginning with “svn-http:” or “svn-https:” will be forwarded to the query_svn library. 
  • Requests for URLs beginning with “ab:” will be forwarded to the query_ab library.

Each of these query libraries implements a common API.  To add a new repository type, all we need to do is implement that API — map the standard set of queries the Cascade cache manager uses to the queries that we can make to the repository.  Then, we simply assign it a unique URL schema as above and add it to a table, and we’re done!  It’s pretty straightforward.

What about third-party addons to support new repository types?  We’ve considered the possibility and may offer some way to do this in the future, but for now we believe providing a third-party API for this would probably cause more problems than it would solve.


Written by Matt

September 19th, 2008 at 2:34 pm

Posted in Cascade

Leave a Reply