Determining front & rear derailleur compatibility
Front and rear derailers are essentially independent -- so long as the two derailers can function with the same type chain they can work together.

Derailer "fit" basically involves 4 factors:


The amount of chain that can be "absorbed" by the arm (rear derailer only)
The index "pitch" of the derailer &amp; its shift lever -- how far it moves in one step (indexed derailers only)
The total distance the derailer can move in and out (adjustable to a degree)
The angle that the derailer describes as it moves in and out


The amount of chain that the rear derailer arm can "absorb" between the most extended chain position and the most "relaxed" is generally specified as a number of teeth, being the difference between the sum of the teeth on the largest front and rear sprockets and the sum of the teeth on the smallest front and rear sprockets.

A sprocket cluster has a number of sprockets joined together with a certain "pitch" -- the distance between sprockets, as measured from (to pick one point) the outermost surface of one sprocket to the outermost surface of the next sprocket.  The "pitch" of the derailer/shift lever must match this sprocket cluster pitch or the derailer will never be able to be adjusted to shift between sprockets.

The total distance the derailer must be able to move is the index pitch times one less than the number of sprockets in the cluster.  Eg, for 5 sprocket cluster with a 5mm pitch the derailer must move 20mm from innermost to outermost.  Note that most derailers can be adjusted with the high and low limits to 2 or 3 different numbers of sprockets.

The angle is a little more complicated, and also not always well documented for different derailers.  The rear cluster on a mountain or touring bike generally has a wide range of sprocket sizes and hence the angle that the derailer movement must describe relative to the axle is fairly steep.  A racing cluster, on the other hand, would tend to have sprocket sizes very close together (only one tooth difference in the extreme case), and so the angle relative to the axle is fairly shallow.  Derailer specifications may state this quantity as a range of sprocket sizes, or a range of teeth (or may omit it entirely). 

(Obviously, "angle" is also an issue for front derailers, and here the acceptable sprocket sizes should be clearly spelled out.  Your standard front derailer may not handle that super-small granny gear, for instance.)

Most 9-speed derailers can be adjusted to work with an 8-speed cluster, so long as the 8-speed cluster is using the 9-speed pitch.  Unfortunately, the pitch of 8-speed clusters is not cast in concrete, but in most cases it's the same as 9-speed.