Answer: Providing shelter and spawning grounds to a wide range of ocean life, coral reefs serve an important role in the marine ecosystem. ... Another role is protection from strong ocean currents and high waves. As the name "barrier reef" implies, reefs act as a barrier protecting the shorelines.
Hope this helps !