VORONEZH, Russia -- Russia’s economy is in a quagmire thanks to sanctions and low oil prices, but it’s a boom time for Mikhail Khorpyakov.

The 32-year-old, who develops software for Russian and foreign clients, has seen his earnings rise over the last two years even as the country fell into recession and the national currency lost half its value.

At the airy, well-lit office he shares with friends in a newly built block in the thriving provincial tech hub of Voronezh, Khorpyakov recalls his last workspace was “in a basement, with noisy sewer pipes all around,” before their earning power allowed them to aim higher.

Get Breaking News Delivered to Your Inbox

Khorpyakov and his friends are part of an unlikely tech revolution in Voronezh, a former Soviet industrial town where startups and online contract work are proving the only source of good jobs and escape from economic decline.

In fact, the crisis has turned out to be the tech sector’s biggest fortune. As Russia fell into recession, the ruble’s nosedive to record lows made tech workers here much cheaper for foreign companies to hire or buy from — letting them compete with traditional tech offshoring hubs like India and China.

Even as officials in the United States and Europe warn about the threat posed by government-backed Russian hackers, tech workers in Voronezh say security concerns don’t affect their international business relationships.

Ivan Grishaev, a 30-year-old software engineer, moved to Voronezh with his wife and son from Chita, a remote city in Eastern Siberia, in 2013. He chose Voronezh because it offered better career options, lower rent and warmer weather than traditional magnets for migrants such as Moscow or St. Petersburg.

The Voronezh River flows in Voronezh, Russia. Boasting several Soviet-era technology-focused universities, Voronezh serves as an outsourcing hub for many Russian and foreign companies. Alexander Zemlianichenko, AP

First he worked for DataArt, a Russian software company with more than 800 employees in Voronezh. But when the ruble’s value plunged, Grishaev struck out on his own, working directly for foreign clients. As well as financial benefits, the change also brought a more flexible work schedule, meaning he can collect his son from school.

Now a self-employed IT specialist developing websites for a Swiss firm, Grishaev makes nearly twice as much as he used to thanks to the difference in local and European salaries, and in currency-exchange rates.

A qualified remote IT services provider working for a Western firm can make $2,000-$3,000 per month. That is up to eight times the average salary for the local region, and double what IT specialists can earn working for Russian companies in Voronezh.

“We’ve become less constrained financially, could afford to have a second child, and now go on vacations abroad,” says Grishaev.

Boasting several Soviet-era technology-focused universities, Voronezh serves as an outsourcing hub for many Russian and foreign companies. Reachable in six hours by car from Moscow — comparatively close by the standards of the world’s largest country - office rent and salaries here are significantly lower than in the capital.

Other rust-belt towns around the world, such as Pittsburgh in the U.S., have seen their local economies helped by a rise in tech companies taking advantage of cheap rents and educated workforces. But Voronezh stands out as an extreme example due to the enormous gains that the ruble’s drop gives tech workers compared with the rest of the local economy.

“We produce games for the Russian-speaking CIS (former Soviet) countries, and make versions for Europe and the U.S., which bring us revenue in foreign currency. Thanks to the exchange rate, this revenue is even bigger in rubles,” says Sergey Khatenkov, head of the Voronezh office of Mail.Ru Group, one of Russia’s largest internet companies.

In 2006, Mail.Ru opened its Voronezh office with five employees. Now it employs 200 people and almost entirely focuses on developing multiplayer online games. Some of the games developed by Mail.Ru in Voronezh, such as Allods Online, count tens of thousands of daily players globally and are one of the company’s main sources of income.

Andrey Shinkarenko, head of the Development Center of Murano Software, a U.S.-Russian company whose business is entirely based on outsourcing, speaks in his office in Voronezh. AP Photo/Alexander Zemlianichenko

“Thanks to the (cheap currency) we’ve significantly increased benefits for our employees,” says Andrey Shinkarenko, head of the Voronezh office at Murano Software, a U.S.-Russian company whose business is entirely based on outsourcing. “We’ve expanded their medical insurance to the fullest, organized meals in the office, that kind of thing.”

With the lower cost, Russian IT software developers are now competing more effectively against their counterparts in India and China. According to TAdviser, an analytics company, software and IT services exports from Russia have been steadily growing since 2010 and hit $7 billion in 2015.

That’s still far from the $82 billion brought in by India’s thriving tech sector, based largely on outsourcing, but Russia has only one-sixth of India’s population.

A key problem for startups in Voronezh is a lack of investment to grow. Many locals with promising ideas eventually up sticks for Moscow or foreign countries.

“The Russian regions are almost dead in this sense - everything revolves around Moscow at a great speed, so if you want to be noticed and newsworthy, you have to go to Moscow,” said Vitaly Yagodkin, head of Perezoni.com, a Voronezh-based online service which provides widgets for websites. He now spends time between the capital, where he holds business meetings to attract new clients, and Voronezh, where his team is based.

Other startup founders head to countries like Germany or the U.S. due to worries that Russia’s legal system doesn’t offer enough protection from predatory officials and investors seeking to seize control of small firms.

Many software engineers in Voronezh are reluctant to leave, given the new tech hub’s combination of low costs and big opportunities.

“As soon as my family and I move (abroad), I will find myself with quite a small salary by European standards,” said Grishaev, the independent outsourcing worker. “I would have to climb up the career ladder again, so I don’t think I need to give it all up and go.”