Ecosystems, such as oceans, rivers, and lakes, sustain themselves through the flow of energy and matter between its biotic and abiotic factors. Biotic factors -- alive elements in an ecosystem -- exist in three main groups, split into five groups total: producers, consumers (herbivores, carnivores, and omnivores) and decomposers. In aquatic systems, examples of these include algae, dugongs, sharks, turtles and anaerobic bacteria.
But some groups, like fish and crustaceans, have member species that exist in different groups of factors. For example: dugongs eat seagrasses, while some species of seal eat penguins and fish, yet both are mammals. While some of these species may seem at odds, like a killer whale and its prey, producer, predator, prey and decomposer populations all play significant roles in regulating the delicate balance of an ecosystem.
TL;DR (Too Long; Didn't Read)
Like all ecosystems, aquatic ecosystems have five biotic or living factors: producers, consumers, herbivores, carnivores, omnivores, and decomposers. Producers are generally plants and algae, consumers include fish, mammals, reptiles, amphibians, crustacean and insects, while decomposers represent bacteria and fungi, and scavengers like shrimp and crabs.
Producers: The Basis of Life
In all ecosystems, producers make up the bottom of the food chain. They use abiotic factors, like sunlight, water and soil to create their own food by photosynthesis. After creating simple sugars through this process, plants often find themselves eaten by another designation of biotic factors: consumers, particularly omnivores and herbivores.
On the land and in fresh bodies of water, plants play the role of primary producer, but in the ocean, phytoplankton and other forms of algae fill this role. Different species of aquatic plants, like lily pads, also provide food for consumers in their respective ecosystems. Aside from making an ecosystem's food, these producers also release oxygen into the water, an essential element for life in within the water.
Herbivores: Peaceful Consumers
Herbivores, a sect of consumers, eat producers, having evolved to eat and digest plant and algae matter over the flesh of other animals. While some fish, like sharks, hunt down and eat living creatures, others slowly graze, and play an important part in keeping producer numbers in check. For instance, fish in coral reef ecosystems consume macroalgae, species that, if left unchecked, can outcompete and kill off coral species. Aside from fish, insects, crustaceans, reptiles (like some species of turtles) and mammals make up the ranks of aquatic consumers.
Carnivores: Limiting Herbivore Populations
While herbivores ensure that producer populations do not grow rampant, carnivores hunt and kill other creatures in the consumer designation: whether they be herbivores, omnivores or other carnivores. Aquatic carnivores belong to similar groupings as herbivores. Mammals like whales, seals and dolphins, crustaceans including shrimp, crabs, and lobsters, fish such as sharks, piranha, pike, bass, and tuna, and reptiles like crocodiles, alligators, aquatic snakes and some species of turtles, all play violent counterparts to their herbivorous kin.
Omnivores: Opportunistic Eaters
Omnivores, which eat both producers and other consumers, play the role of both herbivores and carnivores. They moderate both producer and consumer populations, and have evolved to have a broader diet due to environmental factors like scarcity. Similar to other consumers, mammals, fish, insects, reptiles and crustaceans, like the tadpole shrimp, can be omnivores. Some scientists believe that true herbivores in aquatic ecosystems are rare, and that, instead, the bulk of them are omnivores, as flora is relatively low in nutrients compared to fauna.
Decomposers: Breaking Things Down
In a sense, decomposers do the opposite of producers: they take complex, in some cases formerly living, content in an ecosystem and break it down to simple, usable nutrients for producers. Often, this means breaking down waste from living creatures and their bodies when they die. While bacteria -- anaerobic bacteria in the case of deep seas -- perform the bulk of decomposition, other species help out. Bottom-feeding scavengers like crabs and shrimp help in the process, eating dead things and releasing a simpler form of waste to be further broken down. In fresh water, fungi like water molds and mildews also perform this action.