Culture might be built around what we have - music, art, literature, a dialog with our environment - but technology is built from what we don’t have: it’s a reflection of our needs and longing.

The swath of land between the Mediterranean and the Persian Gulf came to be referred to as the Fertile Crescent, but much of that area was anything but fertile. Though it offered admirable temperatures for year-round agriculture, its rainfall and water supplies were often erratic at best.

As a result, from ancient times, people in the region had to be clever about water use.

They learned to use the Tigris and Euphrates rivers, as well as their tributaries, to set up complex networks of irrigation canals. This allowed them to take advantage of the area’s abundant sunlight, terrific local crops and domestic animals, while limiting the effects of the light, seasonal rainfall and often devastatingly high temperatures.

In the desert, water is everything, and, unlike many places, it is found there or flows through instead of arriving in the form of rain. As civilizations bent the rivers to their will, water became the medium in which they worked, the center of their need and their technology.

Over millennia this technology became increasingly sophisticated, and was ultimately reflected in a pair of remarkable works, written in Arabic by Muslim scientists: The Book of Ingenious Devices, written in Baghdad in the middle of the 9th century, and The Book of Knowledge of Ingenious Mechanical Devices, written in Anatolia in the early 13th century.

These books, while often showcasing tricks, mechanical illusions and elaborate vanity pieces, represent some of humankind’s first attempts at valves, fail-safe systems, automatic controls, and other mechanisms central to engineering (for example, the camshaft, crankshaft, and escapement mechanism).

Automatic fountains, music machines, hand-washing and drink-serving automatons are among the wonders. Water-dispensing devices utilizing a failsafe system which limits the amount of water that can be drawn at one time were developed for use in drought periods, so that farmers could water their crops with just their share of irrigation water. Water clocks (like the famous elephant clock lately reproduced in Dubai) were developed from these irrigation technologies and, in turn, were used to more efficiently conserve water - they led directly to increasingly mechanical clocks which were themselves often used for monitoring irrigation more precisely, doling out water like the automaton waitress serving tea.

Plenty might be pleasant, but constraint can be wondrous.

Many of these innovations and the crops that inspired them were brought by the Muslims to Europe, most especially to areas that they conquered.

Qanats, elaborate underground water systems designed to prevent evaporation, still exist – and, indeed, function – all through Spain and Sicily. Noria and saqiya, tremendous water wheels that lift water for irrigation and other purposes, were brought to Spain and put to work in agriculture.

Dates and almonds, sugar and rice, were introduced to trade networks and became available in Europe’s less hospitable climates, where their popularity exploded, prompting more planting and more irrigation.

Almonds and almond milk filled Northern Europe’s cookbooks, a craze that we’d all recognize today, and it is hard not to imagine this rage for almonds causing medieval Spain the same sort of difficulties that California faces right now. Rainfall and, importantly, the number of days without any rain, are very similar in the almond-growing parts of California and Spain (and in the present-day Fertile Crescent: central Syria).

Oddly, irrigation records suggest that droughts were considerably more prevalent in the 14th century than in the centuries before and after. Farmers of less popular crops no doubt complained, peasants dessicated and nobles wrung their hands, worried that it would be dry forever, that they had planted for themselves a sort of apocalypse. All for that thirsty almond. But irrigation improved, the almond craze faded, and Spain did not dry up and blow into the sea.

Much has been made of the gallon of water it takes to produce a single almond*, and how absurd that seems when California is mired in the worst drought in recorded history. More absurdly, they keep on planting more almond trees. Why not stop growing so many almonds until the drought ends?

Simply, there is money in those almonds, and even more money tied up in those trees. New almond groves still bring in more green than planting lettuce there would (though less money than the last trees planted, and so on) – at least until people tire of the almond’s ubiquity.

*In fairness, walnuts are much much worse and are sometimes found as an industrial pollutant in chocolate chip cookies.

When we look at medieval water technology, we’re looking with a wide angle lens. We see advances solving problems with a smoothness that is never possible in reality.

In California we are forced to confront the granular mess that is the real world. Advances in soil-sensing technology, water-management software, and even older methods like overhead watering systems are all bogged down in the messy process of capitalism, where what pays today may bring catastrophe tomorrow.

In Spain and the Middle East, irrigation edicts were generally issued from on high, but our system can be slower to react to long-term self-interest. And so we pray for rain – for snow, really – to trickle down and feed the irrigation systems that feed the nuts, and if the rain or the technology don’t show up in time, California really might just dry up and blow into the Pacific.