In ecological term, coral reef is an ecosystem in which the main building block is individual stony coral animal
There are three types of coral reefs: fringing reefs, barrier reefs and atolls
Fringing reefs are coral reefs closely encircle the edges of continents.
When the continent sinks gradually and the living fringing corals keep growing upward at a faster rate, a barrier reef and finally an atoll reef will be formed.
Barrier reefs refer to those reefs scattered on the outside of the continental margins with a lagoon separates the land and the reef. The famous Great Barrier Reef in Australia stretches over 2,000 km and is the world's largest barrier reef.
Atoll reefs refer to ring-shaped coral reefs and the water enclosed in the ring is a lagoon.