For the past three years, Chicago police have been analyzing 911 calls to better predict crime patterns across the city and, in one case, actually forecasted a shootout minutes before it occurred.

Now, the city government is turning its big data weapons on the city’s rat population.

The city has 12 years of data on the resident complaints, ranging from calls about rodent sitting to graffiti. Those clusters of data lead the engineers to where the rats can potentially breed. The report is shared with the city’s sanitation team, which later cleans up the rat-infested areas.

“We discovered really interesting relationship that led to developing an algorithm about rodent prediction,” says Brenna Berman, Chicago’s chief information officer. “It involved 31 variables related to calls about overflowing trash bins and food poisoning in restaurants.”

The results, Berman says, are 20% more efficient versus the old responsive model.

Governing cities in the 21st century is a difficult task. It needs a political and economic support. In America, it was only in the early 1990s—when young adults started moving from the suburbs back to the cities—that the academic and policy consensus shifted back toward urban centers. Since then, cities are facing an influx of new residents, overwhelming the service providing agencies. To meet that demand amid the recent budget sequestration, cities like New York, San Francisco, Philadelphia, and Chicago are constantly elevating the art of governance through innovative policies.

Due to this new model, in Chicago, you might not even spot a rat. The city’s Department of Innovation and Technology analyzes big chunks of data to an extent where the likelihood of a rodent infestation is thwarted seven days ahead of resident rat-sightings.

Ester R. Fuchs, professor of international and public affairs at Columbia University and special advisor to former New York City Mayor Michael R. Bloomberg for strategic planning, told Fortune “there are linkages between urban governance structures and an economically successful and environmentally sustainable democratic city.”

“The ability to keep crime down really impacts whether anyone is willing to invest in the neighborhood,” says Fuchs. “That is connected directly to the improvement in the quality of city services and the quality of life in these neighborhoods.”

In September 2012, Chicago government kicked off its free wireless Internet service in public spaces. The city began to use the public data—from online complaints to public tweets—to relieve traffic congestion, monitor public utilities, map out flu vaccination, and ensure speedy snow clearance drives. The rodent baiting project is a new addition to the city’s data-driven approach.

In 2013, Meri Talk, a U.S. government IT network, conducted a survey of 150 federal IT executives and concluded that federal agencies could save $500 billion from big data services.

Chicago’s goal is to equip every service agency with predictive analytics by 2016. This attitude toward governance has put them in the league of the world’s leading smart cities like Amsterdam, Barcelona, and Seoul. “Chicago is generating petabytes of data equivalent to 3,000 years of streaming music,” says Wim Elfrink, executive vice president of Cisco—one of the main companies that sell networking equipment to the city.

The city is deploying more and more sensors and building a cloud-based system to run on Amazon Web Services. “And that is designed to process millions and millions of rows of special data,” says Berman.

Every smartphone adds to the knowledge of the city. The data engineers save every tweet and Facebook post geocoded in Chicago. Then the information is segregated in various clusters from crime to sanitation complaints. From each set, a probability is derived and that leads the city inspectors to the problem.

“We want to leverage the smartphone information to expand our reach,” Berman says. “That’s the power of data.”