The fermentation lock or airlock is a device used in the making of most fermented beverages, including beer, wine, mead, and cider, that allows the carbon dioxide released by the fermenting wort or must to escape from the fermenter, while not allowing air to enter the fermenter, thus avoiding possible bacterial contamination.
Most airlocks used by home fermenters are variations of the same design, which uses a liquid barrier to prevent contamination. These airlocks contain one or more chambers filled with liquid separating the airspace inside and outside the fermenter. When the pressure of the gas inside the fermentation vessel exceeds the prevailing atmospheric pressure the gas will then push its way through the water as individual bubbles into the outside air. The simplest form of airlock is probably the blowoff tube, which is simply a tube running from the fermenter to an open bucket of liquid.
Many brewers simply fill the liquid chamber with water, which in itself acts as a sufficient barrier to contamination. Others use a sanitizing solution in their airlocks. However, this is generally a bad idea with a small airlock. Sanitizer does not offer much, if any, additional protection, since airborne bacteria or wild yeasts are unlikely to be able to pass through any liquid and become airborne again in sufficient quantity to spoil beer. More importantly, under some circumstances, material from the airlock can be sucked into the fermenter, and even unboiled tap water is better for your wort or must than most sanitizers. As a compromise, some brewers use vodka, which is sanitary but will not contribute any flavor or character to the finished product other than a small amount of alcohol.
Liquid can be sucked in from the airlock by extreme changes in temperature or pressure inside the fermenter; for example, when hot liquid in a fermenter cools. However, the most common cause is moving or lifting a flexible plastic fermenter such as a plastic bucket fermenter or Better Bottle. It is rarely a problem with a blowoff tube.
Recently, the manufacturers of the Better Bottle have released a new type of fermentation lock, called the DryTrap™, which does not contain liquid but instead relies on a ceramic ball bearing to create a one-way seal. This eliminates any possibility of liquid being sucked into the fermenter, and also eliminates the possibility that the liquid-based airlock may run dry.