Though these two tech industry behemoths share a number of similarities, Oracle (ORCL 2.02%) shareholders have certainly enjoyed 2017 more than IBM (IBM -1.05%) owners. If not for IBM's recent stock price pop following its third-quarter earnings report, the disparity would be even greater.

Oracle shares are up 29% this year while IBM has meandered its way to a 2.5% loss. But both are transitioning away from legacy hardware sales, and both are laser-focused on their plans to capture major shares of the cloud, artificial intelligence (AI), and software-as-a-service (SaaS) markets. But given their current valuations and long-term prospects, which is the better buy today?

Group of employees posting behind an Oracle sculpture outside headquarters.

Image source: Oracle.

The case for Oracle

With each successive earnings release and quarterly conference call, it becomes clearer that Oracle co-CEO's Safra Katz and Mark Hurd are all about the cloud -- and that it's working. Sort of. Last quarter's $9.2 billion in revenue was a 7% jump  year over year, and cloud sales climbed 51% to $1.5 billion. As Katz put it, "The sustained hyper-growth in our multi-billion dollar cloud business continues to drive Oracle's overall revenue."

Katz, like Hurd and founder CTO Larry Ellison, continually points to revenue gains in the cloud as "wins," but giving that the segment still only accounts of 16% of total sales, Oracle is still in a relatively early stage of its transition. That said, its focus on delivering SaaS solutions is spot on, considering that software as a service expected be one of the fastest-growing segments in the burgeoning cloud market.

Oracle's 61% jump in cloud SaaS sales to $1.1 billion stood out last quarter. Its 21% rise  in earnings per share to $0.52 was also noteworthy. Oracle may not yet have reached the top tier of cloud and AI providers, but it's moving in the right direction.

And it isn't resting on its laurels, as its recently  unveiled automated, AI-driven cloud solution confirms. With the proliferation of Internet of Things (IoT) devices generating unprecedented amounts of data that needs to be analyzed, AI solutions are another hyper-growth opportunity, and Oracle is diving into it, which will help drive the company's growth long into the future.

Picture of a person touching a cloud image on a clear pane of glass.

Image source: IBM.

The case for IBM

Last quarter, IBM's all-important strategic imperatives units picked up steam. As its transition away from the enterprise hardware market continues, the cloud, AI, mobile, and data security continue to account for a greater share of the company's revenue with each passing quarter.

IBM's $19.2 billion in sales  last quarter was flat year over year, ending a string of 21 consecutive quarters of revenue declines -- a  trend that explains its floundering stock price over the past few years. But another double-digit jump in strategic imperatives revenue -- up 11% to $8.8 billion -- not to mention an impressive 20% increase in cloud sales to $4.1 billion, are what investors are beginning to focus on. And rightfully so.

Similar to Oracle, IBM's cloud emphasis revolves around its SaaS solutions, which now boast an annual run-rate of $9.4 billion, up 25% year over year. IBM is also knee deep in an expense management  initiative that has shaved 8% off operating expenses this year, helping to boost EPS to $3.30 a share -- a result that handily beat pundits' expectations. But that improvement in strategic imperatives sales -- which account for 46% of total revenue -- isn't the only feather in IBM's cap.

Trading at a meager 13.5 times  trailing earnings, IBM is valued at less than half its peer average of 28.8. Oracle's valuation is  a bit below its peers at 21.4 times past earnings, but it doesn't offer anything near IBM's appeal for value investors.

And the better buy is...

There's no doubt Oracle is making progress in its efforts to become a significant player in the AI and SaaS markets delivered via the cloud, but it's well behind IBM's annual revenue run-rate of $15.8 billion in these key markets. For investors in search of income in addition to growth, Oracle's 1.5% dividend yield can't compare to IBM's 3.75%.

Bottom line, IBM is further along in its transformation, despite Oracle's continual rah-rah surrounding all things cloud. It's also a better value, and has a dividend yield that's hard to beat. For all those reasons, IBM gets the nod.