An ecosystem consists of a community of organisms together with their physical environment. Ecosystems can be of different sizes and can be marine, aquatic, or terrestrial. Broad categories of terrestrial ecosystems are called biomes. In ecosystems, both matter and energy are conserved.