Homological algebra and sheaves