Dairy farming is a class of agriculture for 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 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.
Worldwide, leading dairy industries in many countries including Bangladesh, India the United States, China, and New Zealand serve as important producers, exporters, and importers of milk. Since the late 20th century, there has generally been an increase in total milk production worldwide, with around 827,884,000 tonnes of milk being produced in 2017 according to the FAO.