A baray is a water reservoir – an area of land where dikes have been raised tobaray catch and hold water. Angkorian kings built massive barays, and such projects became one of the marks of Angkorian kingship. At the center of each barays is and island temple. The first major baray to be constructed (Indratataka), measuring 3.8km x 880m, was completed in 889AD when the capital was still at Hariharalaya near Roluos.
Lolei sat on an island in the middle. Construction of the second major baray (i.e. the East Baray or Yashodharatataka), began almost immediately after the first. At 7.8km x 880m it was almost five times larger than the indratataka. Almost 50 years later, East Mebon was constructed on an island in the center.
The third and largest (8km x 2.2km) is the west Baray built in the early 11th century. West Mebon sits on a central artificial island. The last baray (Jayatataka) was constructed by Jayavarman VII in the late 12th century. It is considered to be the baray of Preah Khan Through the unique temple, Neak Pean, sites at the center.
The function of barays is a matter of academic debate. A recent study has asserted that the barays did not serve an agricultural purpose but were built and maintained for political/religious reasons.
More conventional wisdom has it that the barays were part of a giant water works used to irrigate the rice paddies and provide water for year round cultivation, though they certainly served a political and religious function as well.