Based on an analysis of just under half a million records in the UK Biobank, people who drink two to three cups of coffee each day tend to live longer and exhibit less cardiovascular disease compared with those who abstain from the beverage.

While the research doesn't claim drinking more coffee adds years to your life, it's nevertheless an intriguing association that scientists are keen to investigate further. It's also important to weigh the findings against previous studies linking brain shrinkage and an increased risk of dementia with a daily habit of six or more cups of coffee.

"In this large, observational study, ground, instant and decaffeinated coffee were associated with equivalent reductions in the incidence of cardiovascular disease and death from cardiovascular disease or any cause," says electrophysiologist Peter Kistler, from the Baker Heart and Diabetes Institute in Australia.

"The results suggest that mild to moderate intake of ground, instant and decaffeinated coffee should be considered part of a healthy lifestyle."

The UK Biobank is a large-scale database containing records on individuals' genetics, health, and lifestyle. In this study, the sample provided an average of 12 and a half years' worth of health and dietary information on 449,563 people with a median age of 58.

The participants were grouped according to their daily coffee consumption, and what type of coffee they usually drank – with just over 100,000 people reporting that they didn't drink coffee at all. As part of the analysis, the researchers factored in the effects of age, sex, ethnicity, obesity, high blood pressure, diabetes, obstructive sleep apnoea, smoking status, and tea and alcohol consumption.

From there, Kistler and colleagues could compute differences in heart health outcomes and death from any cause for all coffee drinkers over the study time period, compared to those who didn't drink coffee.

Drinking instant, ground and even decaffeinated coffee were all associated with a lower likelihood of death. Those who drank two or three cups of coffee a day had better odds of living longer than those who didn't drink any.

Researchers can only guess what might be behind the relationship. If it is the coffee itself, a wide variety of potential compounds could be responsible.

"Caffeine is the most well-known constituent in coffee, but the beverage contains more than 100 biologically active components," says Kistler.

"It is likely that the non-caffeinated compounds were responsible for the positive relationships observed between coffee drinking, cardiovascular disease and survival."

Digging deeper, the team found coffee consumption was also linked with the development of cardiovascular disease, with the lowest risk seen amongst those who consumed two to three cups a day.

There were slightly different findings for the risk of arrhythmia or an abnormal heart rhythm – here ground and instant coffee, but not decaffeinated, were linked to a lower likelihood of developing the condition. Once again, just a couple of cups each day seemed to be the sweet spot.

As a lot of previous research has shown, coffee is a complex substance that interacts with the body in a number of complex ways – ways that scientists are still trying to understand. That this study covered so many people over an extended period only adds weight to the link between coffee drinking and longevity.

However, there are some limitations to consider. The database records were predominantly Caucasian, making it harder to generalize the findings across a more ethnically diverse population. Coffee drinking was also self-reported rather than monitored, and the database doesn't factor in changes in coffee consumption or coffee type over time.

For now, sip that morning brew guilt free – chances are it's doing you some good.

"Our findings indicate that drinking modest amounts of coffee of all types should not be discouraged but can be enjoyed as a heart healthy behavior," says Kistler.

The research has been published in the European Journal of Preventive Cardiology.