TEL AVIV - Decades ago Israeli dairy farmers confronted a quandary - how could they provide milk to a fast-growing population in a country that is two-thirds desert, with little grazing land?
They turned to technology, developing equipment that boosted output - from cooling systems to milk meters and biometrics - and have made Israeli cows the most productive in the world.
Science rules today, with cows' health, output, genetics and fertility closely monitored by management systems.
In kibbutzes, or communal farms, across the country, they line up by the dozens to enter climate-controlled sheds, awaiting the latest innovations in robotic milking that drive up efficiency.
This has put the country's agricultural tech, and the companies that provide it, in demand around the world as - with populations and dairy consumption on the rise - traditional farming methods are no longer cutting it.
Smallholder and grazing farms are, for the most part, not competitive. Large, mechanised farms that intensely monitor production and maximise yields are the order of the day.
In the United States, for example, milk production has risen by almost half since 1970, even though the number of cows has declined by about a quarter.
Developing countries, particularly in Asia, want to upgrade their outdated dairy industries and are looking to Israel for products and expertise. So are foreign investors hoping to stay ahead of the curve.
India is the biggest milk producer in the world, but most of it comes from farmers with few resources. Average production levels per cow are low, to the frustration of policymakers.
"We're missing a huge export opportunity to Europe and other countries," said Devendra Fadnavis, chief minister of Maharashtra state, who came to Israel to find a solution. "I think with Israeli technology we can take our farms to the next level."
In Vietnam, a group of Israeli companies led by systems developer Afimilk is building a US$200 million (S$265 million) dairy farm, one of the largest projects of its kind in the world. It will eventually supply half the milk in Vietnam.
Israeli agriculture has benefited from a boom in the country's wider hi-tech industry, which has become a major growth engine and investment magnet. The country leads the OECD when it comes to R&D, spending 4.3 per cent of GDP on it, nearly twice the OECD average, according to Ernst & Young.
Companies often tap into the skills of workers trained in the military or intelligence sectors and start-ups benefit from tax breaks and government funding.
The global market for dairy farming technologies is worth about $850 million a year, according to industry sources. Israel exports in the sector totalled US$110 million in 2014, up 7 per cent rise from a year earlier, according to the country's export institute.
Software company Akol runs a database that monitors the output, health, genetics and fertility of every cow in Israel. The database helped lift productivity to a world record of 12,083 kg per cow in 2014. By comparison, in the United States the average was 10,097 kg.
Akol has partnered with Microsoft in a joint venture to bring the technology to the developing world.
"We understood that to reach the world we need a strong cloud computing system that analyses every component of the quality of the milk. Microsoft saw this could be a breakthrough," said Akol Chief Executive Ron Shani.
He would not disclose how much the software giant invested in the venture, but Akol has put in more than US$10 million.
Start-up miRobot wants to take milking to the next level and says it has developed a prototype of an inexpensive, lightweight robotic arm that can clean, stimulate and attach the milking pump to the cow's udder entirely on its own. It can be added on to existing systems, cutting the need for extra manpower.
Such Israeli technologies have not gone unnoticed.
France-based Allflex, a designer of animal identification systems with factories in the United States, Brazil, New Zealand and China, bought Israeli milking technology company SCR in December for US$250 million.
In another vote of confidence, China's vast Bright Food conglomerate bought Tnuva, Israel's largest dairy firm, for US$1.1 billion earlier this year.
"The macro conditions, are very favourable for Israel's dairy tech industry," said Arama Kukutai, managing director of California-based Finistere Ventures that has a US$150 million agtech fund.
"The country's high-tech pedigree extends into agriculture, and we've been looking at opportunities to invest."