On the edge of the San Francisco Bay, tech giants have been buying up land and building massive complexes in a flood zone. As sea levels rise by a projected 2 feet over the next few decades, the question remains as to who will pay to protect these multi-billion dollar companies.

According to reporting by NPR, Google's (GOOGL  ) $3 billion campus has added more than 70 properties in the last five years. Many of these properties and much of the campus itself fall within the area projected to be underwater within decades. Facebook's (FB  ) $2.5 billion state-of-the-art campus is at even greater risk, with nearly the entirety of the property falling within the projected flood zone. That is unless shoreline protection measures are put in place.

These tech giants aren't the only ones likely to suffer from rising sea levels. With some of the highest housing costs in the country, in a place where $120,000 per year is seen as average at best, Silicon Valley only has a few low-income communities. Nestled between and around Google and Facebook, the already struggling communities of Belle Haven and East Palo Alto are also facing flooding.

Currently, local governments are planning a massive levee project to stretch along the edge of the bay. However, they can't afford the millions of dollars the project is likely to cost. Since much of what is at risk is considered public infrastructure, many cities are seeking federal funding to help foot the bill. The problem with using federal funding is that there's only so much of it to go round

"It's going to be trillions of dollars, in my opinion, just in the United States," University of California, Davis, professor of environmental science and policy, Mark Lubell, told NPR. "Even if you added up all the state and federal money that's out there, it doesn't pay that price tag."

To make up the shortfall, cities are now looking at raising taxes, though who will bear the brunt of those taxes has yet to be decided. After all, many wonder if all residents should have to pay higher taxes in order to protect private landowners, many of whom knew they were building in a flood zone.

"Is fair share based on how much risk you're facing?" assistant Professor A.R. Siders at the University of Delaware's Disaster Research Center told NPR. "Is it based on your ability to pay? This is a problem because there's no scientific answer. This is ethics. This is personal values."

Residents in Belle Haven and East Palo Alto have already faced floods over the years, and East Palo Alto was one of a select number of communities that received federal government funding for a levee project to protect the region. The community paid $5.5 million, and Facebook, bordering a portion of the levee, paid $7.8 million, or 0.0009% of its revenue from last year.

"There is no reason why the residents or the public should subsidize the benefits that those corporations get," Carlos Romero, Mayor of East Palo Alto, told NPR.

Already, Facebook's one-million-square-foot campus is surrounded by 9-foot-tall dirt mounds, or earthen berms. However, these don't offer the same protection as a levee, according to Kevin Murray, the senior project manager of the area's flood protection agency, San Francisquito Creek Joint Powers Authority.

Despite the levees that are in place, the bay is still considered a flood zone because those protections reportedly don't meet the safety standards put in place by the Federal Emergency Management Agency and aren't considered suitable for protecting people.

"We know that the structures that are providing flood barrier now are not adequate and are subject to failure if we have a really big tide or a big wind event or a big storm surge," Murray told NPR.

According to a report from the California Natural Resources Agency, depending on the amount of greenhouse gasses humans emit in that time, the San Francisco Bay is expected to rise by between 0.9 feet and 1.9 feet. Within the past hundred years, the bay has risen by roughly 8 inches.

However, within 100 years, levels could rise by 5 feet or more.