Although there are 124 known species of coffee, most of the coffee that's grown comes from just two - Arabica and Robusta.
Robusta makes up about 30% of global coffee production, and is mainly used for instant coffee. As the name implies, it is a strong plant - but for many, its taste cannot compare to the smooth and complex flavours of Arabica.
It is Arabica that drives the industry and accounts for the majority of coffee grown worldwide, but it is a more fragile plant and only tolerates a narrow band of environmental conditions. It is particularly sensitive to changes in temperature and rainfall.
In 2012, research by a team from the UK's Royal Botanic Gardens, Kew, revealed a bleak picture for wild coffee in Ethiopia, where Arabica originated. They did a computer modelling exercise to predict how environmental changes would affect Arabica for the rest of the century. They forecast that the number of locations where wild Arabica coffee grows could decrease by 85% by 2080 - the worst-case outcome was a 99.7% reduction.
"If we don't do anything now and over the next 20 years, by end of the century, wild Arabica in Ethiopia could be extinct - that's in the worst-case scenario," says Dr Aaron Davis, head of coffee research at Kew, who led the project.
The report made headlines around the world and spurred the industry into action. Since then, the team from Kew and their partners in Ethiopia have covered 25,000km in Ethiopia, visiting coffee producing areas to compare their predictions with what is happening in reality. "It's important to see what's happening on the ground, observing what influence climate change is having on coffee now, and talking to farmers. They can tell us what has happened, sometimes taking us back many decades, with several generations of farmers involved," says Davis.
The team is now working with the Ethiopian government to find ways to safeguard the coffee industry. Moving production to higher ground - where it's cooler - might be part of the solution. Some areas currently unsuitable for coffee growing may become suitable in the future. "It's jeopardy and threat in some areas, but opportunity in others," says Davis.
Little was known about wild Arabica until quite recently - it was not until the end of the 19th Century that scientists confirmed it as an Ethiopian plant, rather than Arabian, as the name suggested. Dr Tadesse Woldermariam Gole, an Ethiopian wild coffee specialist, only completed his work on mapping wild Arabica a few years ago. It is now known that wild Arabica coffee grows only in southern Ethiopia, on either side of the Rift Valley, and on the Boma plateau in South Sudan.
Kew's research has wide-ranging implications, not just for Ethiopia's many small-scale coffee producers, but also for the rest of the world. Anything that poses a threat to the indigenous, wild varieties of Arabica grown in Ethiopia is likely to affect commercial varieties even more. Environment is a key factor, but there is another reason too - genetics.
"Wild species have much greater genetic diversity - anything happening in the wild populations is usually amplified in commercial varieties where the genetic diversity is so much less," says Justin Moat, Kew's head of spatial analysis.
Commercial coffee, grown in plantations, is thought to have no more than 10% of the genetic variety of wild Arabica. Put simply, it is in-bred.
The reasons for this lack of genetic diversity are partly historical. Many plantations were established from single plants, shipped out to various colonies - a single plant was taken from Amsterdam's botanical gardens to Surinam in 1718, another was sent to Martinique in 1720, and so on.
And since then, very few new varieties have been developed. "Unlike many other crop species, coffee has had very little research behind it, says Dr Timothy Schilling, executive director of the World Coffee Research institute (WCR).
Schilling says coffee is "an orphan crop", meaning it has been grown in tropical countries that did not have the resources to invest in research. Coffee only has about 40 plant breeders, compared to thousands in crops like corn, rice or wheat.
"Richer countries buy it, roast it and drink it, but have not paid for the agronomy. Only now is the industry waking up and seeing the need for it. The coffee industry has realised no-one else is doing it - it's going to have to be us," says Schilling. "But there is a big gap in our knowledge. For example we didn't know the genetic base was so small."
Just how small became clear earlier this year.
In 2013 WCR thought it had found a gold mine of genetic variation - 870 strains of wild Arabica coffee, growing in Costa Rica's Center for Tropical Agricultural Research and Education. The plants had been collected in Ethiopia the 1960s by the UN's Food and Agriculture Organization and distributed to more than a dozen countries in an effort to increase diversity - this was one of the only collections to survive.
"We took every one of those strains and sequenced the DNA strands and matched them one by one to see what diversity there was," says Schilling. "We got the results back in the beginning of the year and there was amazingly little diversity. It was a big shock. We knew it was small, but not that small."
"As a result, we don't have the diversity in available Arabica coffees that we need for the next 200 years."
Lack of diversity in crops can have disastrous consequences - it makes them more susceptible to disease. And coffee has a foe - coffee leaf rust. The fungus wiped out Sri Lanka's coffee plantations entirely in the late 1800s, and there was a bad outbreak in 2013 in Central America. The coffee grown there had no resistance to the disease - the crop relied on the protection of low temperatures at higher altitudes.