An ecosystem consists of all the living and non-living things in an environment that interact with each other. Ecosystems can vary in size from small terrariums to large oceans. They contain producers that make their own food, consumers that eat other organisms or producers, and decomposers that break down dead material. Nutrients and energy flow through ecosystems in food chains from producers to various levels of consumers. There are two main types of ecosystems - terrestrial ecosystems located on land surrounded by air like forests, grasslands, and deserts, and aquatic ecosystems located in water environments like rivers, lakes, oceans, and lagoons.