A dam is a structure built across a stream or river to hold water back. The primary purpose of a dam is to store water for irrigation, municipal, or industrial use. Dams can also be used to control flooding, generate electricity, and provide recreational facilities. Modern dams can be classified into two types: concrete dams and embankments. Concrete dams or masonry dams block streams that run through narrow gorges, whereas embankments control streams and rivers which flow through broad valleys. Dams can have advantages such as mitigating floods, retaining detrimental sedimentation, preventing the disposition of hazardous material and subsequent contamination, and providing recreational facilities. However, they also have disadvantages such as the displacement of people and wildlife, the alteration of natural habitats, and the risk of dam failure.