A bird colony is a large congregation of individuals of one or more species of bird that nest or roost in proximity at a particular location. Many kinds of birds are known to congregate in groups of varying size; a congregation of nesting birds is called a breeding colony. Colonial nesting birds include seabirds such as auks and albatrosses; wetland species such as herons; and a few passerines such as weaverbirds, certain blackbirds, and some swallows. A group of birds congregating for rest is called a communal roost. Evidence of colonial nesting has been found in non- neornithine birds ( Enantiornithes), in sediments from the Late Cretaceous ( Maastrichtian) of Romania. 
Approximately 13% of all bird species nest colonially.  Nesting colonies are very common among seabirds on cliffs and islands. Nearly 95% of seabirds are colonial,  leading to the usage, seabird colony, sometimes called a rookery. Many species of terns nest in colonies on the ground. Herons, egrets, storks, and other large waterfowl also nest communally in what are called heronries. Colony nesting may be an evolutionary response to a shortage of safe nesting sites and abundance or unpredictable food sources which are far away from the nest sites.  Colony-nesting birds often show synchrony in their breeding, meaning that chicks all hatch at once, with the implication that any predator coming along at that time would find more prey items than it could possibly eat.  
What exactly constitutes a colony is a matter of definition. Tufted puffins, for example, are pelagic birds that nest on the steep slopes and rocky crevices on coastal cliffs, often on islands. Each pair excavates its own burrow. A congregation of puffin burrows on a marine island is considered a colony.    Sand martins (called bank swallows in North America) are seldom, if ever, observed to nest in solitude; such a dependence on social nesting would term the bird a colonial nester.  A more extreme example of colonial nesting is found in the weaverbird family. The sociable weaver of southern Africa constructs massive, multi-family dwellings of twigs and dry grasses, with many entrances leading to different nesting chambers, accommodating as many as a hundred nesting pairs. These structures resemble haystacks hanging from trees, and have been likened to apartment buildings or beehives. 
Some seabird colonies host thousands of nesting pairs of various species. Triangle Island, for example, the largest seabird colony in British Columbia, Canada, is home to auks, gulls, cormorants, shorebirds, and other birds, as well as some marine mammals.  Many seabirds show remarkable site fidelity, returning to the same burrow, nest or site for many years, and they will defend that site from rivals with great vigour. This increases breeding success, provides a place for returning mates to reunite, and reduces the costs of prospecting for a new site. Young adults breeding for the first time usually return to their natal colony, and often nest very close to where they hatched. Individual nesting sites at seabird colonies can be widely spaced, as in an albatross colony, or densely packed like an auk colony. In most seabird colonies several different species will nest on the same colony, often exhibiting some niche separation. Seabirds can nest in trees (if any are available), on the ground (with or without nests), on cliffs, in burrows under the ground and in rocky crevices. Colony size is a major aspect of the social environment of colonial birds.
Some birds are known to nest alone when conditions are suitable, but not sometimes. The white-winged dove of southwestern North America was known to nest in large colonies when foraging areas could support such numbers. In 1978, in Tamaulipas, Mexico, researchers counted 22 breeding colonies of white-winged doves with a collective population size of more than eight million birds. But as habitat was transformed through urbanization or agriculture, the doves apparently spread out into smaller, less long-lived colonies. Today, these doves are observed to nest singlyin both urban and not urban areas.  
The term colony has also been applied, perhaps misleadingly, to smaller nesting groups, such as forest-dwelling species that nest socially in a suitable stand of trees. The red-cockaded woodpecker, an endangered species of southeastern North America, is a social species that feeds and roosts in family groups, or clans. Clans nest and roost in clusters of tree cavities and use a cooperative breeding system.  Many parrot species are also extremely social. For example, the thick-billed parrot is another bird that nests and roosts communally; individuals of neighboring roosts has been observed to communicate with each other each morning to signal their readiness to form flocks for foraging.  However, these complex social structures in birds are a different sort of group behavior than what is normally considered colonial.
The habit of nesting in groups is believed to provide better survival against predators in several ways. Many colonies are situated in locations that are naturally free of predators. In other cases, the presence of many birds means there are more individuals available for defense. Also, synchronized breeding leads to such an abundance of offspring as to satiate predators.
For seabirds, colonies on islands have an obvious advantage over mainland colonies when it comes to protection from terrestrial predators. Other situations can also be found where bird colonies avoid predation. A study of yellow-rumped caciques in Peru found that the birds, which build enclosed, pouch-like nests in colonies of up to one hundred active nests, situate themselves near wasp nests, which provide some protection from tree-dwelling predators such as monkeys.  When other birds came to rob the nests, the caciques would cooperatively defend the colony by mobbing the invader. Mobbing, clearly a group effort, is well-known behavior, not limited to colonial species; the more birds participating in the mobbing, the more effective it is at driving off the predator.  Therefore, it has been theorized that the larger number of individuals available for vigilance and defense makes the colony a safer place for the individual birds nesting there. More pairs of eyes and ears are available to raise the alarm and rise to the occasion.
Another suggestion is that colonies act as information centers and birds that have not found good foraging sites are able to follow others, who have fared better, to find food.  This makes sense for foragers because the food source is one that can be locally abundant. This hypothesis would explain why the lesser kestrel, which feeds on insects, breeds in colonies, while the related common kestrel, which feeds on larger prey, does not. 
Colonial behaviour has its costs as well. It has been noted that parasitism by haematozoa is higher in colonial birds and it has been suggested that blood parasites might have shaped adaptations such as larger organs in the immune system and life-history traits.  Other costs include brood parasitism and competition for food and territory.   Colony size is a factor in the ecological function of colony nesting. In a larger colony, increased competition for food can make it harder for parents to feed their chicks. 
The benefits and drawbacks for birds of nesting in groups seem to be highly situational. Although scientists have hypothesized about the advantages of group nesting in terms of enabling group defensive behavior, escape from predation by being surrounded by neighbors (called the selfish herd hypothesis), as well as escaping predators through sheer numbers, in reality, each of these functions evidently depends on a number of factors.  Clearly, there can be safety in numbers, but there is some doubt about whether it balances out against the tendency for conspicuous breeding colonies to attract predators, and some suggest that colonial breeding can actually make birds more vulnerable.  At a common tern colony in Minnesota, a study of spotted sandpipers observed to nest near the tern colony showed that the sandpipers that nested nearest the colony seemed to gain some protection from mammalian predators, but avian predators were apparently attracted to the colony and the sandpipers nesting there were actually more vulnerable.  In a study of a least tern colony in Connecticut, nocturnal avian predators in the form of black-crowned night herons and great horned owls were observed to repeatedly invade a colony, flying into the middle of the colony and meeting no resistance. 
For seabirds, the location of colonies on islands, which are inaccessible to terrestrial predators, is an obvious advantage. Islands where terrestrial predators have arrived in the form of rats, cats, foxes, etc., have devastated island seabird colonies. One well-studied case of this phenomenon has been the effect on common murre colonies on islands in Alaska, where foxes were introduced for fur farming. 
Colony-nesting birds have been used by humans as a source of food in the form of eggs and meat, down for bedding, feathers for quill pens, and guano for fertilizer. Over-exploitation can be devastating to a colony, or even to an entire population of a colonial species. For example, there was once a large seabird known as the great auk, which nested in colonies in the North Atlantic. Eggs and birds were used for a variety of purposes. Beginning in the 16th century, seafarers took the birds in especially great numbers to fill ships' larders, and by the mid-19th century, the great auk was extinct. Likewise, the short-tailed albatross of the North Pacific was heavily harvested at what seems to have been its primary colony on Torishima Island. Millions of birds were killed in less than two decades at the end of the 19th century. The species survives, though endangered. In North America, the extermination of the highly gregarious passenger pigeon has been well documented. The birds were hunted as if inexhaustible. Case in point: in 1871, in Wisconsin, an estimated 136 million pigeons nested in a dense congregation over a wide area; thousands of people were drawn to hunt the birds, shipping the squab to market by rail. The passenger pigeon is a famous example of a familiar bird going extinct in modern times. 
The use of seabird droppings as fertilizer, or guano, began with the Indigenous Peruvians, who collected it from sites along the coast of South America, such as the Chincha Islands. When, after the Spanish Conquest, the value of this fertilizer became known to the wider world, collection increased to the point where the supply nearly ran out, and other sources of guano had to be found. 
Seabird colonies can be predominately a single species or a mix of species:
A dense colony of Sandwich terns (Sterna sandvicensis)
Colonial nesting can be so close that multiple nests are interwoven:
Monk parakeet nest colony
Another variation is to have closely grouped separate nests:
Red-rumped cacique nest colony by a river.
Nest holes of sand martins
Artificial gourds provided for purple martins, USA
Heronries and rookeries are often in the top of a stand of trees: