A granary is a storehouse for threshed grain or animal feed. In ancient or primitive granaries, pottery is the most common use of storage in these buildings. Granaries are often built above the ground to keep the stored food from mice and other animals.
From ancient times grain has been stored in bulk. The oldest granary yet found dates back to 9500 BC and is located in the Jordan Valley, followed by Mehrgarh in the Indus Valley from 6000 BC. The ancient Egyptians made a practice of preserving grain in years of plenty against years of scarcity. The climate of Egypt being very dry, grain could be stored in pits for a long time without sensible loss of quality. The silo pit, as it has been termed, has been a favorite way of storing grain from time immemorial in all oriental lands. In Turkey and Persia, usurers used to buy up wheat or barley when comparatively cheap, and store it in hidden pits against seasons of dearth. In Malta a relatively large stock of wheat was preserved in some hundreds of pits (silos) cut in the rock. A single silo stored from 60 to 80 tons of wheat, which, with proper precautions, kept in good condition for four years or more.
Simple storage granaries raised up on four or more posts appeared in the Yangshao culture in China and after the onset of intensive agriculture in the Korean peninsula during the Mumun pottery period (c. 1000 B.C.) and in the Japanese archipelago during the Final Jōmon/Early Yayoi periods (c. 800 B.C.). In the archaeological vernacular of Northeast Asia, these features are lumped with those that may have also functioned as residences and together are called 'raised floor buildings'.
Towards the close of the 19th century, warehouses specially intended for holding grain began to multiply in Great Britain, but North America is the home of great granaries, known there as grain elevators. There are climatic difficulties in the way of storing grain in Great Britain on a large scale, but these difficulties have been largely overcome. To preserve grain in good condition it must be kept as much as possible from moisture and heat. New grain when brought into a warehouse has a tendency to release moisture. Bacteria are more active in this condition and can heat the grain. If the heating is allowed to continue the quality of the grain suffers. An effectual remedy is to turn out the grain in layers, not too thick, on a floor, and to keep turning it over so as to aerate it thoroughly. Grain can thus be conditioned for storage in silos.