Wonderful creations of nature

This is a coral reef, I think.

I have never seen a location like this on any other beach. This place is located in the Galle Koggala area of Sri Lanka. You can tell by sight that this is not a rock reef. But how can a coral reef be located on the water's surface next to the land?🤔