With last year’s revelations about the National Security Agency’s intrusive spying practices, and the disastrous rollout of the US health-insurance website HealthCare.gov, now may not seem the best time for the United States to establish a national network to collect and analyse health data from millions of patients.

Good luck, then, to the government-backed Patient-Centered Outcomes Research Institute (PCORI), which is trying to do just that.

In December, the institute in Washington DC launched the PCORnet project to collate medical records, physiological data and insurance claims from as many as 30 million US patients through 29 web networks — a dream cohort for any biomedical researcher. Last month, the organization began building the computer infrastructure that will tie these records together, allowing researchers to spot trends in how lifestyles affect health, which drugs are most effective for certain types of individual, and so on. If it works as advertised, these findings could save millions of dollars by allowing researchers to recruit the right participants for clinical trials and doctors to prescribe the right treatments for individuals.

Designing a US$94-million programme that draws big data from dozens of computer systems is an enormous challenge — just ask former Health and Human Services secretary Kathleen Sebelius, who resigned last week after months of technical problems with HealthCare.gov. But the ethical issues may prove an even higher hurdle. The United States would do well to watch the United Kingdom as it grapples with creating its own national database, care.data (see Nature 507, 7; 2014). Although the UK national health system is much more mature and cohesive than anything the United States has, the project’s rollout has been delayed for months because of unanswered questions about informed consent and access to sensitive patient data.

Even if PCORI can solve its technical and ethical problems, it will be some time before the project measures up to systems such as Denmark’s MedCom, which collates comprehensive patient data going back to 1977 and provides an indispensable resource for researchers doing longitudinal studies. The system seems to work, largely because of its transparency about how the data are used.

PCORI says that it will let patients help to determine research priorities, and promises that only anonymous data and no individual records will be available to researchers. It is crucial that the institute follows through, to maintain patients’ trust. Without that, neither researchers nor patients will benefit. As the old saying goes, you make your own luck.