Smart cities are coming.

Municipal governments around the globe are employing big data and Internet-of-Things applications to improve many aspects of daily life. Major tech companies like IBM, Cisco and Microsoft are in on the trend, and are battling for a slice of the $15 billion that's projected to be spent on software by 2021, according to Juniper Research.

Urban residents accounted for 54 percent of the total global population in 2014, according to the World Health Organization, and that figure was projected to grow nearly 2 percent each year until 2020.

That growth means that cities are facing increasing challenges, including congested transport and the need to supply sufficient energy to meet demands of growing populations.

Juniper Research noted a city's ability to provide renewable energy, alongside its means to efficiently manage energy storage will be increasingly important.

"Right now North America and China are leading the way, although Trump is likely to dampen what is already slowing U.S. investment," Steffen Sorrell, principal analyst at Juniper Research said.

President Donald Trump has supported fossil fuel production and repeatedly denied climate change.

"Who would have thought 10 to 15 years ago, that the Far East and China would be leading the globe in smart energy efforts by 2020?" Sorrell said.

Still, many challenges remain for cities on their way to becoming "smart." Major upfront costs for both infrastructure and software are propelling many governments to turn to public-private partnerships.

CNBC looks at three cities working on becoming "smart":