In most aquatic ecosystems, as in terrestrial ones, plants, predominantly algae, that use solar energy, carbon dioxide, water and inorganic nutrients for growth are the starting point of the food web. Some bacteria are also capable of photosynthesis, but hydrogen sulphide is usually the donor of hydrogen, never water. These photosynthetic bacteria, which are anaerobic, can live only in anoxic environments and never release oxygen.
Other bacteria are capable of chemosynthesis, deriving the energy to capture carbon from a range of inorganic compounds, such as ammonia, nitrite, methane, ferrous iron and sulphides. These bacteria are found throughout the water column, but they are usually more abundant in anoxic waters where decaying organic matter releases such substances.
In some estuaries, chemosynthetic production can rival that of photosynthesis. In ocean areas where hot, mineral-rich water vents from fissures in the ocean floor (known as "black smokers"), chemosynthetic bacteria provide the food for locally very productive ecosystems. Apart from these unique ocean environments, the pattern of biological productivity generally follows the availability of plant nutrients and sunlight in the water.