Dairy farming is a class of agriculture for the long-term production of milk, which is processed (either on the farm or at a dairy plant, either of which may be called a dairy) for the eventual sale of a dairy product. Dairy farming has a history that goes back to the early Neolithic era, around the seventh millennium BC, in many regions of Europe and Africa. Before the 20th century, milking was done by hand on small farms. Beginning in the early 20th century, milking was done in large scale dairy farms with innovations including rotary parlors, the milking pipeline, and automatic milking systems that were commercially developed in the early 1990s.
Milk preservation methods have improved starting with the arrival of refrigeration technology in the late 19th century, which included direct expansion refrigeration and the plate heat exchanger. These cooling methods allowed dairy farms to preserve milk by reducing spoiling due to bacterial growth and humidity.