Amazon has a history of dropping cash on companies, like its $13.7 billion cash acquisition of Whole Foods in 2017. But when it announced in its latest earnings report that it planned to increase investments in 2019, the company’s shares fell 5 percent, even dropping into bear territory on Friday.

But Amazon may want to continue to buy up smaller companies, said Daniel Ives, managing director of equity research at Wedbush Securities — especially if it wants to keep up with cross-town rival Microsoft, which is rapidly advancing in the "cloud" arms race.

“Amazon's biggest nightmare is what is happening on the other side of town in Seattle and Redmond, Washington," said Ives. "Microsoft is really starting to get a strut in their step with cloud and that is sending shivers down the spine of Amazon. If you look at what Microsoft are doing on the cloud side, they are aggressively going after Amazon."

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

Amazon reported $7.4 billion in cloud revenue last year, marking a 45 percent increase from the same period the previous year. However, it’s still down from 49 percent from two quarters earlier.

“It's a cloud arms race going on. Amazon has been miles ahead of the competition, but that gap is narrowing. We believe this is going to lead to more mergers and acquisitions this year,” said Ives.

Microsoft does not break out its cloud revenue for investors, but said it was up 76 percent in its second-quarter earnings for 2019, which Chief Executive Officer Satya Nadella said was a reflection of “our deep and growing partnerships with leading companies in every industry.”

In Microsoft’s earnings call on Wednesday, Amy Hood, the company’s chief financial officer, said the company is picking up more large, long-term contracts from Microsoft Azure clients, including a five-year deal with Gap.

Microsoft is a massive competitor to Amazon and is expected to close some of the gap. However, Amazon is still in a dominant place, despite the slight deceleration, according to Patrick Moorhead, principal analyst at Moor Insights & Strategy.

“AWS delivers more profit dollars to the company than all its retailing and products combined. It is natural for the percent growth to slow a little bit as a business gets large,” said Moorhead. “Investors needs to recognize that the 45 percent gain is on a huge base of business. AWS’s real-dollar growth was larger than Azure, GCP, and Oracle combined.”

There’s still a massive opportunity to reach new customers who have not migrated to the cloud, so the next few years will be pivotal as the tech giants lean heavily on growing their services revenue. The cloud services market is expected to be worth $555 billion globally by next year, according to a report by Allied Market Research.