Coral reefs are with well-defined structures that involve both photosynthetic plants and consumers in the sense explained in the article on . The outer layer of a reef consists of living of coral. Within the coral animals live single-celled, round algae called zooxanthellae. Below and surrounding the polyps is a calcareous skeleton, both living and dead, that contains filamentous green algae. Other species of algae, both fleshy and calcareous, grow in the surface of old skeletal deposits. These algae and other associated plants make up most of the primary producers.
The photosynthetic zooxanthellae and filamentous green algae transfer some food energy directly to the coral polyps. Coral animals also feed at night on zooplankton, which they capture with their tentacles. Coral animals prey on zooplankton not so much for the calories but for scarce nutrients, especially . Through digestion, coral animals release these nutrients to the algae. Coral and algae then apparently cycle these nutrients between them, reducing nutrient loss to the water.
Herbivorous fish, such as the colourful , as well as , , , and numerous species of mollusc, feed on algae. Hiding in the numerous caves and crevices of a reef are predatory animals such as small crabs, wrasses (long, spiny-finned fishes), , and . The numerous microhabitats and the productivity of the reefs support a great diversity of marine life.
Coral reefs are of three types: fringing reef, barrier reef, and . Fringing reefs extend outwards from the shore of an island or mainland, with no body of water between reef and land. Barrier reefs occur farther offshore, with a channel or lagoon between reef and shore. Atolls are coral islands, typically consisting of a narrow, horseshoe-shaped reef enclosing a shallow lagoon.
Coral reefs have recently been affected by bleaching, that is, the discoloration or loss of symbiotic zooxanthellae. In 1979 and 1980, several incidents of coral bleaching occurred at reefs around , , north-east Australia, and the Caribbean Sea. A more extensive outbreak of bleaching occurred in 1982 and 1983, including reefs off east Africa, Indonesia, and the west coast of Central and South America. Bleaching incidents even more widespread and damaging occurred over the three-year period from 1986 to 1988, including areas such as Taiwan, Hawaii, Fiji, Mayotte Island, and the entire length of the . In 1998 mass bleaching affected coral reefs worldwide and destroyed about 90 per cent of coral in the central Indian Ocean. In 2002 it was estimated that about 25 per cent of the world’s reefs had irrevocably been lost; however, reefs in some parts of the world, notably in East Asia, were beginning to show tentative signs of recovery.