There's a Shimano model compatability chart out there.
Basically all Shimano road components work together except 7900 front derailleur and brakes. Those use a different cable pull. Shimano 9sp MTB rear derailleurs work with Shimano road shifters but 10sp MTB does not. Sram cassettes fit Shimano 8/9sp splines and work with Shimano derailleurs. Sram front derailleurs and brakes match the pre-7900 cable pulls. Sram rears use their own cable pull but some Sram MTB derailleurs use the same pull. Campy is different from both Shimano and Sram for rear derailleurs but fronts and brake cable pull matches Sram/pre-7900 shimano.