Both Microsoft (MSFT 0.37%) and Oracle (ORCL 0.22%) have been traveling a long, sometimes difficult road for the past few years. The two tech titans are in the process of reinventing themselves into cloud, software-as-a-service (SaaS), and data analytics market leaders -- but each is delivering on its transformation efforts.

Wasn't long ago -- the summer of 2013 -- that a partnership was inked in which Oracle made its software solutions available on the then-newish Microsoft could platform Azure. But as they continue their transitions today, it's safe to say that there's a lot less congeniality and a lot more competitiveness. So, which one has the edge in the race to win the cloud wars, making it the better buy for investors?

Image source: Oracle

The case for Oracle

The reason Oracle agreed to the aforementioned partnership with Microsoft is directly related to co-founder and now CTO Larry Ellison's infamous disgust with all things cloud-related: at one time, he called the whole notion of the cloud "idiocy." Needless to say, Ellison has changed his tune, and Oracle is better for it. Today, its quarterly earnings releases and conference calls are littered with cloud-speak, and excitement about the almost unlimited potential the burgeoning market offers.

Oracle's multiple cloud wins are driving its sound financial results, mostly compensating for a steady decline in traditional software sales. Last quarter -- fiscal 2016 Q4 -- Oracle's $10.6 billion in revenue was down a mere 1%, despite a 12% drop in software license sales, one of its primary sources of revenue. The difference was made up for by an impressive 66% jump in SaaS and platform-as-a-service (PaaS) revenue delivered via the cloud.

Combined with its cloud infrastructure revenue, total cloud sales increased 49% year over year to $859 million in the quarter, and Oracle enjoyed the same growth rate on an annual basis, generating $2.85 billion in fiscal 2016. At 6%, Oracle's cloud sales remain a relatively small piece of its total revenue , but that's up from just 4% the prior year, and climbing.

In other words, not only is Oracle moving in the right direction in delivering on its cloud initiatives, there's almost unlimited upside in a market expected to exceed $100 billion in 2016.

Image source: Microsoft

The case for Microsoft

Like Oracle, Microsoft is not only committed to winning in the cloud, it intends to do so by focusing on SaaS and PaaS sales -- far and away the largest opportunity the fast-growing market offers. And it's delivering in a big way. As of last quarter -- Microsoft's fiscal 2016 Q4 -- it boasted a $12.1 billion annual cloud revenue run-rate.

Excluding a $2 billion adjustment due to a change in Windows 10 revenue reporting, Microsoft's revenue in Q4 increased 2% to $22.6 billion, and it sure wasn't its dying phone business leading the charge. In addition to a 102% increase in revenue from its Azure cloud platform, Microsoft delivered across all its business segments -- except for phone sales, which to no one's surprise declined again last quarter, this time by 71%.

But that was the only hiccup to end Microsoft's fiscal year. Office 365 commercial sales climbed 54%, and consumer subscribers rose to 23.1 million, compared to "just" 15.2 million a year earlier. Dynamics CRM -- delivered via the cloud, of course -- more than doubled its user base in Q4. And the popularity of Windows 10 OS also grew, driving a 16% improvement in Bing search revenue.

So, which is the better buy: Microsoft or Oracle? The difficulty in answering that question is that both are sound, long-term growth alternatives that also offer shareholders a decent dividend: Oracle's yield is 1.5% and Microsoft's 2.5%. That said, Ellison's early reluctance to embrace the cloud has left Oracle behind industry-leading Microsoft and its $12.1 billion annual cloud run-rate.

Both tech giant's will get to, or near, the top of the cloud mountain, but Microsoft will undoubtedly get there first, which is why it edges out Oracle as the better buy.