Aquarium Ecology Overview

This page gives a high level overview of the aquarium ecosystem, tracing energy and nutrients as they enter and leave the tank. The topic pages cover specific subsystems such as the nitrogen cycle, decomposition, gas exchange, and more.

To ground various concepts we will refer back to a typical tank which illustrates all of the main ideas, noting where different styles of tanks have significantly different behavior. This example tank is 60 litres with gravel substrate, a sponge filter, some floating and rooted plants, a handful of shrimp and snails, and a small school of fish.

A bounded system

An aquarium ecosystem is nicely bounded which makes it easier to study and reason about than a natural system. A hobbyist controls all inputs and outputs to the tank besides gases which exchange at the surface.

Like all living systems, aquariums fundamentally convert inputs of low entropy to outputs of high entropy, with life facilitating the transition and growing and dying as a result. The two low entropy inputs to our aquarium are light from a window sill or bulb, and fish food. Light provides only energy, while fish food provides both energy and matter. Energy ultimately leaves the tank as heat while matter remains and cycles between organic and inorganic pools. Other inputs to the tank include water added during water changes, gases dissolving into the water, and fertilizer. Exports include water removed during water changes, gases outgassing from the water, plant trimmings, and anything removed during cleaning.

Aside from these inputs and outputs, every atom which is in the system today will be in the system next week, potentially as part of a different organic or inorganic pool than it is now. A tank with very few inputs and outputs (e.g. a no-feed Walstad style shrimp tank) largely maintains the same quantity of every atom over long periods of time, and can sustain a vibrant ecosystem as those atoms are passed between various species powered by the low entropy source that is light.

Following a nitrogen atom

To see the system in action, we can trace the likely fate of a nitrogen atom which enters the tank as protein in a flake of fish food. The flake is eaten by a fish, which keeps some of the nitrogen as growth and excretes the rest through its gills as ammonium. After entering the water column, ammonium has two likely fates. First, it can be taken up directly by our plants or algae as it is their preferred nitrogen source. It can also be taken up by nitrifying bacteria and oxidized into nitrite and then nitrate. Nitrate can also be taken up by our primary producers but is a less preferred source, so it often builds up in a tank between water changes.

Let's say the ammonium is taken up by algae growing as a thin film on the glass wall of the tank. One of the shrimp comes by and eats the algae, assimilating some of the nitrogen and egesting some of it as part of a fecal pellet. This pellet settles on the bottom of the tank as detritus, eventually becoming food for heterotrophic bacteria and fungi which decompose it and re-release the nitrogen (mineralization), or assimilate it and become food for protists, getting us back to the start of the cycle.

If instead the ammonium is taken up by one of our larger plants, it will likely stay locked up in plant biomass for longer, and only leave the tank when plants are trimmed back, or only become available again when a plant dies or senesces.

Where the nitrogen is
Nitrogen by pool
Nitrogen in the example tank over six months. Includes fish being fed daily, a weekly 25% water change, and the floating plants thinned whenever they cover three quarters of the surface.

Following light and carbon

Another core system to trace is light, which is directly coupled to carbon. Light enters the tank and hits a leaf or algal cell. The producer then uses the light energy to pull CO2 from its surroundings (the water column for our rooted plants and algae, the air for our floating plants) and creates sugars, releasing O2 as a byproduct. This relatively simple process, photosynthesis, has an enormous impact on our ecosystem. The sugars act as stored energy in our aquarium. Every step of the food chain afterwards is releasing most of that energy as heat, and running photosynthesis in reverse via respiration which consumes O2 and releases CO2. Plants and algae respire, a microbe feeding on algae respires, a shrimp feeding on microbes respires, etc. All of the energy powering this food chain is fixed by photosynthesis on the first step, and heat is released along the way (only ~10% of the total energy is passed on at each trophic step).

Living actors

Three main guilds are responsible for keeping nutrients cycling through our aquarium. These are producers, consumers, and microbes.

Producers (plants and algae) fix carbon and store light energy as sugars, releasing oxygen in the process. They are the main nutrient sink in our tank, and quickly suck up phosphorus and nitrogen as it becomes available. They also help form the physical structure of the tank. Leaves provide a large amount of surface area which hosts biofilm, shades parts of the tank, and provides shelter for certain organisms. Rooted plants change the chemistry of our substrate by releasing oxygen and organic compounds, creating the rhizosphere. See Producers.

Consumers (fish, shrimp, snails, misc. mesofauna) concentrate nutrients. A snail grazing on biofilm converts a dilute substrate into dense tissue. Consumers are also the main way nutrients move around physically in the aquarium. A shrimp will graze algae on a leaf and then drop a fecal pellet on the other side of the tank where it decomposes. Consumers also release a good portion of ammonium from their food sources into the water column, which is why more animals require more planting and/or more frequent water changes to keep ammonium levels healthy. Fish are a special case because we feed them from outside the tank, making them the primary route by which nutrients are added to the system. See Consumers.

Microbes make nutrients available again. Heterotrophic bacteria and fungi decompose fecal pellets, dead leaves, and uneaten food. Nitrifying bacteria oxidise ammonium into nitrate (nitrification). Below a couple centimeters of our gravel substrate, or a few millimeters of soil or sand, the water between the grains (pore water) runs out of oxygen, and a different set of bacteria takes over decomposition. Anoxic bacteria reduce (breathe) nitrate, then iron oxide, then sulfate, and then CO2 rather than oxygen. In that order because each rung yields less energy than the rung before it. Denitrification (nitrate reduction) matters most for our system because it converts nitrate into nitrogen gas, and is one of the only ways nitrogen leaves the system naturally. Sulfate reduction creates hydrogen sulfide, causing a tank to smell like rotten eggs. CO2 reduction creates methane which bubbles up when substrate is disturbed, and iron oxide reduction releases phosphate into the pore water, feeding rooted plants. Microbes are also food. Protists eat bacteria, small animals eat protists, and that is how the carbon in detritus finds its way back into the snails and shrimp (microbial loop). See Microbes.

Important chemistry

One of the quickest ways for an aquarium ecosystem to collapse is if oxygen runs out. Oxygen exchanges across the water surface in whatever direction pushes the dissolved concentration towards equilibrium (gas exchange). However, the rate at which it equilibrates is highly variable depending on surface agitation, temperature, airflow, and floating plant cover. When exchange is low, dissolved oxygen acts as a semi-fixed budget which the tank must balance to avoid a crash. During the day producers photosynthesize and add oxygen to the water. Throughout the day and night, plants, animals, and microbes are respiring, bringing down the O2 budget and releasing CO2. If this happens too quickly and O2 can't be dissolved from the air fast enough, animals will die and the system will crash.

A day in the example tank
Dissolved oxygen
pH
Three days of dissolved oxygen and pH in the example tank. During the day O2 rises as submerged plants and algae photosynthesize, and it falls overnight as respiration continues in the dark. pH follows the same pattern because photosynthesis removes CO2 from the water and respiration puts it back. The swings are small because most of the photosynthesis is done by floating plants which do not add oxygen to the bulk water column. In a heavily fed tank with the same plants the pattern can be inverted, with O2 falling as the morning's food is decomposed and recovering overnight.

Alkalinity (KH, aka carbonate hardness) is the water's capacity to absorb acid without pH being lowered. It should not be confused with general hardness (GH) which in fresh water is largely a measure of calcium and magnesium ions and has no buffering effect on pH. In an aquarium alkalinity is almost entirely a measure of bicarbonate, and pH is almost entirely the relationship between bicarbonate and dissolved CO2, which is a weak acid. Alkalinity is a fixed budget and is consumed by nitrification and plants taking up ammonium. This is why in a fed tank, where nitrogen is added, alkalinity must be replenished. Denitrification and plant uptake of nitrate give some alkalinity back. One common misconception is that the pH of water added to your aquarium affects your pH. In reality tap water will not contain acids (other than CO2) or bases, and the KH of the water being added is the only relevant factor for how it will influence your tank's pH. pH is important because it determines what fraction of your tank's ammonium exists in its toxic form, it sets how much of your dissolved carbon is available for plants as CO2 vs. bicarbonate, and extreme pH is directly toxic to most aquarium species.

What a test kit reports as "Ammonia" is not actually a single molecule. It is the combination of non-toxic ammonium (NH4+) and toxic ammonia (NH3) whose proportion depends on the pH and temperature of the water. Ammonia is toxic at relatively low levels and is often the cause of animals dying. At 25 °C and pH 6.5, 0.2% of total ammonia is NH3. At the same temperature with a pH of 9, 37% is NH3. So, the same test kit reading is ~200 times more dangerous at pH 9 than it is at pH 6.5. Temperature works the same way, but is less impactful than pH. A 10 °C increase pushes the NH3 fraction at a pH of 9 from 37% to 53%.

Timescales

Different processes in the tank happen over different timescales, and knowing those timescales can help you better recognize the various stages of those processes and identify if anything is going wrong.

Over a single day-night cycle, pH climbs while light is hitting the tank and CO2 is stripped from the water by primary producers. The degree to which it moves depends on the alkalinity. O2 is added to the water during the day, and stripped from the water at night when photosynthesis stops but respiration continues. The lowest O2 levels will be right before dawn making this the most dangerous time for animals in low oxygen tanks.

Over the first weeks, the tank 'cycles'. A fresh tank has very little nitrifying bacteria, so ammonia from water changes or added directly builds up. In 2-3 weeks ammonia oxidizing bacteria (AOB) establish well enough to convert the ammonia into nitrite. After nitrite builds, nitrite oxidizing bacteria (NOB) populations build enough to convert the nitrite into non-toxic nitrate, completing the cycle. Planting has a minor effect on the timing of this cycle, as live plants will carry some nitrifying bacteria letting them establish faster. The main cycling effect of planting is to reduce both the ammonia and nitrite peaks as both are directly taken up. Cycling time can be shortened dramatically by adding filter media or substrate from a tank which already has an established cycle.

Cycling a new tank
Started from tap water
Seeded with media from a running filter
A fishless cycle in the example tank before anything is stocked, started from tap water alone (top) and with a squeeze of media from a running filter (bottom). Following a typical fishless cycling procedure with ammonia dosing. Once a day ammonia is topped back up to 1 mg N/L (about 1.2 ppm), which is the expected ammonia load of our stocking, except on days when nitrite is high, when none is added. No water is changed. Dosing stops when ammonia and nitrite both read zero the day after a dose. The tap water here carries 0.4 mg N/L of nitrate (about 2 ppm on a kit), a little less than the example tank's, so the nitrate line does not start on top of the ammonia line.

Over the first months, communities replace each other in a fairly predictable order (succession). Diatoms are replaced by green algae as silica levels in the water drop. Thin layers of algae on surfaces give way to thicker more complex biofilms, which provide food and shelter for a greater variety of micro and mesofauna. AOB and NOB nitrifying bacteria slowly give way to comammox bacteria, which are better at scavenging low levels of ammonia. Macrophytes grow out and increase their nitrogen uptake capacity, becoming better at outcompeting algae.

Over years, whatever is added to the tank and does not leave builds up. Detritus accumulates and its oxygen demand with it. Nitrification consumes alkalinity making pH less stable if not replenished. Anoxic substrate transitions from producing nitrogen gas and dissolved iron to producing hydrogen sulfide and methane as its nitrate and iron oxide are used up. These slow trends can cause a stable tank to suddenly fail after years if not kept on top of.

Stable and failing systems

Everything described above comes down to a handful of budgets which must balance long term in a healthy aquarium. Energy entering the tank must leave as heat. Oxygen produced during the day must match respiration during the day and night. Nutrients added to the tank must leave through water changes and/or plant trimmings or they accumulate over time.

WCs close the nitrogen budget in a fed tank
Nitrate
Nitrate in the example tank over three months with a weekly 25% water change and with top-offs only. Fed fish add nitrogen every day. With water changes the export matches the input and nitrate settles at a level.

In a stable aquarium these budgets all close, on average over weeks and months. Grazers eat the algae down, then decline due to food limitation, letting the algae rebound and supporting a rebound in grazers. Nutrients move between organic and inorganic pools steadily rather than accumulating in certain pools and being locked off from the others.

In an aquarium which fails, one of the budgets doesn't close. Water changes are too infrequent, and/or planting is insufficient, and ammonium builds to toxic levels. Respiration exceeds photosynthesis, and air exchange isn't enough to make up the difference, causing animals to suffocate. Grazers eat algae to such a low level that they all starve before the algae can rebound. The alkalinity buffer is depleted enough that pH creeps outside of a healthy range during the day-night swing. Each of these has a recognizable shape and early warning signs covered in Stability and Failure.