An ecosystem is a community of living things and their non-living environment, and may be as large as a desert or as small as a puddle. An ecosystem must contain producers, consumers, decomposers, and dead and inorganic matter. All ecosystems require energy from an external source – this is usually the sun.