Coral reefs are formed by coral polyps, which are small marine invertebrates related to jellyfish and anemones. Coral polyps secrete calcium carbonate to build protective structures called coralites. Over time, the accumulation of coralites forms three types of reef structures: fringing reefs near shorelines, barrier reefs separated from shorelines by lagoons, and atolls surrounding central lagoons. Coral reefs provide habitat for many species but are threatened by rising water temperatures and pollution.