The collective microorganisms and their genomic elements and interactions in a particular environment.