The U.S. grid was the greatest engineering feat of the 20th century. But it is looking increasingly vulnerable and inefficient in the 21st century.

A few weeks ago, the Wall Street Journal reported that if just nine of the 55,000 electric-transmission substations were knocked out, our entire country would plunge into a blackout that could last weeks. More recently, CleanTechnica reported that Americans are using more energy than ever — to the tune of 2.3 quadrillion thermal units more.

Consider those two pieces of information side by side for a moment. Our grid is incredibly vulnerable to attack and pressure on the grid (caused by increase energy use) is only increasing. Even without a coordinated attack, severe weather events are already costing the US between $25 to $70 billion a year through power outages.

That’s the bad news. The good news is that we know how to fix it. The solution lies in moving away from the highly centralized energy system and towards something that looks more like the internet with decentralized energy production and smart technology that allows us to utilize that energy most efficiently.

This shift is already beginning to happen at the local level, particularly in California. The city of Lancaster, California made headlines when it became the first city to mandate solar power for all new single-family homes. More recently, Lancaster, realized that solar by itself isn’t enough and decided to create an integrated system of EV chargers and intelligent energy storage.

Last week, Redwood City became the first city in the Bay Area to install EV chargers and energy storage to complement their existing solar system.

The shift towards a decentralized system isn’t purely altruistic one. With demand charges for peak energy use growing by more than 10% annually in California, cities are smart to invest in integrated storage and alternative energy systems to lower their electric bills.

At the federal level, we’re spending hundreds of billions of dollars a year to upgrade our aging grid. The DOE estimates that 70% of US transmission lines are 25 years or older, 70% of power transformers are 25 years or older, and 60% of circuit breakers are more than 30 years old.

The U.S. Department of Energy has recognized this challenge, releasing a Grid Energy Storage report outlining the need to modernize the electric grid with energy storage in order to meet projected energy needs, reduce infrastructure investments, provide grid stabilization and backup power in case of an emergency.

Just imagine if all of our cities and towns had their own energy systems, with forms of alternative energy best suited to the local climate (solar, wind, geothermal, hydro) and systems to store that energy in order to use it the most efficiently. Picture a city with rooftops filled with solar to power homes during the day, wind turbines running at night and stored energy used to regulate the demand in between.

The greatest engineering feat of the 21st century will require a different kind of engineering. We’ll replace hardware with software, copper with predictive energy algorithms and large-scale centralized energy systems with localized clean energy. It’s imperative that we get there.