As drought lowered reservoirs and scorched front lawns, California residents looked longingly to the great body of water at the continent’s edge: the Pacific Ocean, tantalizingly close but undrinkable. At least, until recently.

This December, Poseidon Water, a Boston-based infrastructure developer, opened the world’s largest desalination plant in Carlsbad, Calif., a coastal city just north of San Diego. Seventeen years in the making, the new facility removes the salt and purifies 50 million gallons of ocean water every day. At the moment, the technology is expensive — nearly double the price of importing water from outside the county — but Poseidon’s executives believe that extreme weather events and population booms in the future will make water scarcer and, by extension, drive up the price.

“Seawater desalination is the only water supply in the county that’s drought-proof,” says Jessica Jones, spokesperson for Poseidon. “It’s not dependent on snowpack or rainfall.”

Reverse osmosis membranes, inside the Carlsbad Desalination Plant.

A water source like it has been a dream of humankind’s since ancient times, when marooned sailors first tried to remove the salt from seawater by catching the steam rising from boiling pots. In the 1960s, scientists hit upon a way to extract pure water molecules from a tainted source. Using reverse osmosis, the briny water (already treated to remove algae and silt) flows through pipes equipped with a porous membrane, its holes barely one-millionth the diameter of a human hair, Jones explains. At extremely high pressures, the water molecules pass through these microscopic holes, but salt ones are too large to fit. Jones compares the process to trying to fit a baseball into a tennis ball can.

The process works so effectively that Poseidon is in the final stages of obtaining permits to open a similar plant in Orange County’s Huntington Beach. Environmentalists have voiced concerns about damage to sea life sucked in by the facility, but to offset any loss of marine life, Poseidon is restoring wetlands south of San Diego to be a bird and fish habitat.

Could Poseidon’s executives be correct in their belief that technology like this will be the only way to prepare for a harsher, dryer world that’s rapidly approaching?

MORE: This Sustainable ‘Farm of the Future’ Is Changing How Food Is Grown