This article is by Bryon extracted from Tropical Fish Keeping forum.
Bacteria are essential for life on the earth, and they exist everywhere; in only one milliliter of freshwater there are a million bacteria cells, invisible to the naked eye. The name bacteria is the plural of bacterium, which is the Latinized form of the Greek bakterion [bakteria] which means a staff or cane, so named because the first bacteria discovered were rod-shaped. They are single-celled prokaryote microorganisms; prokaryotes are organisms that lack a cell nucleus. Bacteria occur in two forms, autotrophic and heterotrophic.
Autotrophic bacteria synthesize their own food, and they require oxygen so they are termed aerobic. Some do this via photosynthesis using sunlight, oxygen and water. Others use chemosynthesis, a process whereby they manufacture carbohydrates from carbon dioxide (CO2) and water using chemical nutrients rather than sunlight as the energy source. Science now believes that chemosynthesis was what allowed life to begin on earth, a view supported by the fairly recent discovery of the remarkable ecosystems around the hydrothermal vents on the ocean floor that have absolutely no relationship with sunlight—conditions very similar to those that initially existed on the earth for hundreds of millions of years before any form of life appeared.
Heterotrophic bacteria cannot synthesize their own food so they need organic material such as fish waste, dead bacteria, fish and plant matter, etc., and while some are aerobic, many are facultative anaerobes, meaning that they can survive in either the presence or absence of free oxygen. Anaerobes are organisms that do not require free oxygen for growth. This has significant consequences in aquaria.
The nitrogen cycle bacteria in aquaria are lithotrophic; the word comes from the Greek lithos [= rock] and troph [= consumer], so literally it means “rock eater.” Realistically, it means these bacteria colonize surfaces. The scientific processes that cause this may most simply be described as the bacteria being pulled from the water by several actions occurring on the surfaces. Bacteria are sticky; they exude protein coatings that allow them to build up into a slimy film that we term a biofilm. These also attract and bind fungi and algae. Snails, shrimp and fish seen grazing these mats are feeding on the countless microscopic creatures and algae that live there. But this is not their most important function; these biofilms are absolutely essential to a healthy aquarium because of the bacteria they contain.
The Nitrogen Cycle
Nitrogen comprises about 80% of our atmosphere, and every life form on earth works hard to acquire it. In the aquarium, nitrogen exists in four forms: ammonia [NH3], ammonium [NH4], nitrite [NO2] and nitrate [NO3].
Ammonia is a by-product of all aerobic metabolisms—fish, snails, invertebrates, fungi and bacteria; it naturally occurs from continuous biological processes and living organisms in any aquarium, and even at very low levels this ammonia is very highly toxic to all life. At levels between 0.5 and 1 ppm there can be long-term or permanent gill damage. Ammonia is never healthy at levels that can be detected by our standard test kits, and in most cases will have negative effects on the fish. 
The fastest uptake of ammonia in an aquarium occurs with live plants; ammonia can be both assimilated (as a nutrient in the ionized form ammonium) and taken up (as a toxin, NH3) by plants. But ammonia is also taken up (though more slowly) by certain nitrifying bacteria, and this produces another form of nitrogen—nitrite, which is also highly toxic to all life at very low levels. Fish readily absorb nitrIte from the water and it combines with the hemoglobin in their blood, forming methaemoglobin. As a consequence, the blood cannot transport oxygen as easily and this can become fatal. At 0.25 ppm nitrite begins to affect fish after a short period; at 0.5 ppm it becomes dangerous; and at 1.0 ppm it is often fatal.
Another group of bacteria take up nitrite, producing nitrate, which is still toxic though much less so. High levels of nitrate, above 40 ppm, have been shown to slow fish growth, suppress breeding, and depress the immune system making the fish much more susceptible to disease. While different fish species show some variation in tolerance, a level below 20 ppm is recommended, and preferably below 10 ppm. After all, most of our fish occur in waters with nitrate so low it can scarcely be measured. Live plants and regular partial water changes both work to achieve this desired state in a balanced aquarium.
The bacteria responsible for this nitrification process of converting ammonia to nitrite to nitrate are termed nitrifying. But the nitrogen cycle is only complete (in aquaria) when it includes de-nitrification; in this stage, different bacteria that are termed denitrifying convert nitrate into nitrogen gas which is released back into the atmosphere. Another component of the complete nitrogen cycle in nature but not present in our aquaria involves the “fixing” of atmospheric nitrogen by cyanobacteria and other life forms.
Nitrification is the oxidation of ammonia/ammonium to nitrite and then the subsequent oxidation of nitrite to nitrate; this is performed by two groups of bacteria known collectively as nitrifying bacteria or nitrifiers. True nitrifying bacteria are autotrophs; they use chemosynthesis to manufacture their energy by using oxygen plus nitrogenous waste (ammonia or nitrite) and carbon (from CO2). There are several different bacterium species involved, all in the family Nitrobacteraceae, that carry out this function in soil, and it used to be thought that these, particularly Nitrosomonas europa and Nitrobacter, were the nitrification bacteria in freshwater. But Dr. Timothy Hovanec led the team of scientists that proved this to be a mistaken assumption. Ammonia is converted to nitrite by bacteria of the Nitrosonomas marina-like strain  and nitrite is converted to nitrate by bacteria closely related to Nitrospira moscoviensis and Nitrospira marina.  With several subsequent scientific studies by other scientists on wastewater nitrifying bacteria this data is now accepted and confirmed scientific fact.
Once established, the population of these bacteria in an aquarium will be in direct proportion to the amount of ammonia or nitrite respectively. Nitrifying bacteria require 12-32 hours to multiply, which they do by binary division [each bacterium divides into two bacteria]. Nitrosomonas multiply in less time (12+ hours) while Nitrospira require more time (up to 32 hours). In a new aquarium, it can take up to eight weeks for the bacteria populations to reach a level capable of eliminating ammonia and nitrite.
Scientific studies have also now proven that Nitrospira are inhibited and cannot multiply in water that contains significant concentrations of ammonia, and evidence exists to suggest that existing populations of Nitrospira actually become dormant when ammonia is present in high concentrations. Kim et al. (2006) determined that with an active ammonia [NH3] level of 0.7 mg/l (=ppm) Nitrospira bacteria experienced a decrease of 50% effectiveness, resulting in an accumulation of nitrite. 
The pH has a direct effect on nitrifying bacteria. These bacteria operate at close to 100% effectiveness at a pH of 8.3, and this level of efficiency decreases as the pH lowers. At pH 7.0 efficiency is only 50%, at 6.5 only 30%, and at 6.0 only 10%. Below 6.0 the bacteria enter a state of dormancy and cease functioning.  Fortunately, in acidic water (pH below 7.0) ammonia automatically ionizes into ammonium which is basically harmless. And since nitrite will not be produced when the ammonia-oxidizing bacteria are in “hibernation,” this decrease in their effectiveness poses no immediate danger to the fish and other life forms.
Temperature also affects the rate of growth of nitrifying bacteria. It will be optimal at a temperature between 25 and 30C/77 and 86F. At a temperature of 18C/64F it will be 50%. Above 35C/95F the bacteria has extreme difficulty. At both 0C/32F (freezing) and 100C/212F (boiling) the bacteria die.
These bacteria cannot survive drying out; without water, they die. Tap water with chlorine or chloramine will kill these bacteria. Antibacterial medications will negatively impact the nitrifying bacteria to varying degrees; Coppersafe does not.
These heterotrophic bacteria, of which there are several species, utilize nitrate by consuming the oxygen within nitrate and releasing nitrogen gas. They do not require free oxygen in the water so they are facultative anaerobes, and generally occur in what we term “dead spots,” which occur when water movement is stopped and thus no oxygen is available. These are the good guys among heterotrophs, since de-nitrification is important in a healthy aquarium. And they will naturally occur in the lower level of the substrate as will be explained below.
Waste Control Bacteria
These species of heterotrophic bacteria break down dead organic matter like fish waste, dead fish or plant matter, uneaten fish food, dead bacteria, etc. Some are aerobic, but many species are facultative anaerobes, able to live with or without oxygen. Like all bacteria, they colonize surfaces, and these are most prevalent in the substrate and the filter media. Many species can survive complete drying, allowing them to remain potent even when filter media that has been previously used is completely dry.
These bacteria have only one requirement to appear and live: organics. They compete with autotrophic bacteria for both oxygen and surface area; studies show that even in relatively clean environments, they occupy more than 50% of the available surface area. And given that they can reproduce within 15-60 minutes—compare this to the 12-32 hours required bynitrifying bacteria—you can see how easily these heterotrophic bacteria can overwhelm the system. In a filter, if sludge is allowed to increase, heterotrophic bacteria will multiply so fast they actually smother and kill the autotrophic nitrifying bacteria.
The best control is limiting organic carbon which comes from dead organic matter. In non-planted tanks this is more crucial, and here is where carbon filtration helps, since it adsorbs organic carbon which is essential for these bacteria. Regular partial water changes, minimal feeding, removal of any dead fish or plant matter, rinsing filter media often, never using products that purport to reduce sludge—all these will aid in controlling heterotrophic bacteria. Live plants is one of the best methods; oxygen is released into the substrate, and plants assimilate the organic nutrients.
The greatest population of bacteria in a healthy balanced aquarium occurs in the substrate, not the filter. The floc or humic compost that collects in the substrate is the host for the biofilms; this is why the substrate in planted tanks should never be disturbed, and many aquarists apply this to non-planted tanks as well.
In very general terms, aerobic nitrification takes place in the top 1-2 inches of the substrate; anaerobic de-nitrification takes place approximately 2-4 inches down, and anaerobic bacteria producing hydrogen sulfide occurs in substrates deeper than 3-4 inches. In all three cases, it will be deeper in coarse substrates (like pea gravel) and more shallow in finer substrates such as sand. These generalities will also vary with the presence of live plant roots and substrate “diggers” such as snails and worms, since these factors result in more oxygen being made available in the substrate, reducing anaerobic bacteria activity. An oxygen level in the substrate of as little as 1 ppm promotes nitrogen reduction rather than sulfur reduction (hydrogen sulfide). 
Maintaining a substrate of fine gravel or sand no deeper than 4 inches, having live plants rooted in the substrate, and keeping Malaysian Livebearing snails are the best and safest methods of providing a healthy biological system for aerobic and denitrifying anaerobic bacteria.
These are most common in new tanks. Established tanks rarely have them, except when the balance is disturbed [explained below]. Heterotrophs appear sooner and faster. They build many of the biofilms that all bacteria use to adhere to surfaces, and they reproduce much faster, around 15 to 60 minutes, compared to hours for the autotrophs. So if heterotrophs cause the bacterial bloom in a new tank, and yet there is very little if any obvious organic waste, how? Well, when water is dechlorinated, it can suddenly support bacteria, and the “organic waste” in the water itself feeds the heterotroph bacteria and it very rapidly reproduces and clouds the tank milky white. This will occur in fishless cycling with just ammonia. It is usually less likely, or will be minimal by comparison, with live plants because they assimilate nutrients from organics.
As was previously mentioned, heterotrophs are facultative anaerobes—unlike autotrophs which need oxygen—so they can switch between aerobic and anaerobic depending upon the environment. This is why they can kill so many nitrifying bacteria in filters when the filter is allowed to get clogged. When heterotrophs bloom in the water they switch to being aerobic and consume vast amounts of oxygen. This is the real danger of a bacteria bloom, as it can starve the fish of oxygen. Increasing aeration may be advisable.
In an established tank, a bacterial bloom is caused by something that upsets the biological balance by increasing the organic matter too quickly, such as overfeeding, excessive decaying plant and animal matter, excess waste from overcrowding, etc. Here, the heterotrophs quickly reproduce by feeding on this organic matter. This produces ammonia as a by-product, and the sudden surge in ammonia overtakes the nitrifying bacteria that need time to “catch up.” Live plants again help here, as they can assimilate and/or take up considerable quantities of ammonia faster. Note that the bacterial bloom causes the rise in ammonia, not the opposite as some may think.
A water change is not recommended to clear a bacterial bloom. When the free-floating heterotrophs are removed, the others will reproduce even faster to compensate, thus worsening the bloom. If left alone, they usually dissipate in a few days. In an established tank, however, the source of the problem should be removed. Clean the gravel, remove decaying matter, don’t overfeed, reduce overstocking, etc. And be aware of the oxygen shortage issue.
 For more detailed information, see “Nitrogen Cycle,” The Skeptical Aquarist website. Also Neil Frank, “Ammonia Toxicity to Freshwater Fish” on The Krib website. Also Robert T. Ricketts, “Aquarium Microbes, Part 1, Nitrification” on The Aquarium Wiki website.
 Paul C. Burrell, Carol M. Phalen, and Timothy A. Hovanec, “Identification of Bacteria Responsible for Ammonia Oxidation in Freshwater Aquaria,” Applied and Environmental Microbiology, December 2001, pp. 5791-5800.
 Hovanec, T. A., L. T. Taylor, A. Blakis and E. F. DeLong, “Nitrospira- Like Bacteria Associated with Nitrite Oxidation in Freshwater Aquaria,” Applied and Environmental Microbiology, Vol. 64, No. 1, pp. 258-264.
 Kim, D.J., D.I. Lee and J. Keller (2006), “Effect of temperature and free ammonia on nitrification and nitrite accumulation in landfill leachate and analysis of its nitrifying bacterial community by FISH,” Bioresource Technology 97(3), pp. 459-468.
 Kmuda, “Aquarium Bacteria and Filtration Manifesto,” Parts 1 and 2, OscarFish website.
 Strohmeyer, Carl, “Nitrogen Cycle and Aquarium & Pond Cycling,” American Aquarium Products website.