There was a time when these two companies dominated the technology scene. IBM (NYSE:IBM) was at the vanguard of computing since before World War II. Oracle (NYSE:ORCL) didn't arrive until the late 1970s but was no less important: It ushered in the age of database and enterprise software.

However, both have been lapped up in terms of market capitalization by younger peers; Apple and Microsoft serving as prime examples. That doesn't mean, though, that their stocks can be forgotten about. Combined, IBM and Oracle are still valued at over $300 billion. 

Female and Male IT Engineers Discussing Technical Details in a Working Data Center/ Server Room with Internet Connection Visualization.

Image source: Getty Images.

Between these two, which is the better stock to buy at today's prices? We'll examine them through three different lenses to figure that out.

Financial fortitude

Once you accept that a financial crisis -- whether it affects just one company or the entire economy -- can happen at any time, you can appreciate financial fortitude. Having a large war chest and lots of predictable cash flow coming in not only helps buffer a company against a crisis, but it can actually allow an organization to benefit from unanticipated events -- by acquiring rivals, repurchasing its own shares, or simply grabbing market share while the competition scales down operations.

Keeping in mind that Oracle has a market capitalization that's roughly 45% larger than IBM's, here's how the two stack up:

Company Cash Debt Free Cash Flow
IBM $15 billion $40 billion $14 billion
Oracle $67 billion $56 billion $14 billion

Data source: Yahoo! Finance. Cash includes short- and long-term investments. Free cash flow presented on a trailing-12-month basis.

Clearly, both companies have very strong cash flows. That's important, but it doesn't offer any real differentiation in picking a winner. For that, we look at the net-cash balances. This means the amount of cash and short- and long-term investments left after we subtract out the long-term debt on the balance sheet.

While the terms of its debt aren't onerous, and the company shouldn't have too much trouble meeting its obligations, IBM's net cash position is nowhere near as strong as Oracle's: negative $25 billion. It found itself in this position due to its financing arm that helps customers buy their mainframe systems -- a wise business initiative, but one that limits options in a downturn. Now IBM does have an offsetting asset of approximately $29 billion in receivables from its financing programs on its books, but collections for these could potentially slow during a significant downturn. 

Oracle, on the other hand, has a net cash position of $11 billion, which offers it much more flexibility.

Winner = Oracle

Valuation

It's hard for a seasoned professional to determine if a stock is "expensive" or "cheap," let alone an investing newbie. This is inexact, and it's part art, part science. 

Here are five metrics I like to consult to build out a more holistic view of valuation:

Company P/E P/FCF PEG Ratio Dividend FCF Payout
IBM 12 10 10.8 4.4% 40%
Oracle 19 14 1.7 1.6% 23%

Data source: Yahoo! Finance, E*Trade. P/E calculated using non-GAAP earnings where applicable. P/E = Price-to-earnings. P/FCF = Price-to-free cash flow. PEG = Price-to-earnings growth. 

I must admit I'm a bit stumped on this match-up. On almost every metric, IBM looks like the better bet: It has lower ratios for earnings (P/E) and free cash flow (P/FCF), a much larger dividend yield, and -- though it's proportionally higher than Oracle's -- it uses a very sustainable amount of its free cash flow to pay that dividend.

But then we look at the PEG ratio, which takes earnings growth into consideration. On that mark, IBM is six times more expensive than Oracle. The reason is pretty simple: As IBM has pivoted from mainframes to a focus on Strategic Imperatives (more on that below), its earnings have faltered. The transition takes time, and earnings have been flat to negative for four years now. Oracle, on the other hand, has shown steady -- if modest -- earnings growth over the same time frame.

I think the difference in growth rates is already factored into the price via the P/E and P/FCF of each company, and I believe IBM's shift to recurring revenue is showing signs of driving profitable growth in the future. As such, I'm choosing not to allow the enormous PEG ratio to stop me from giving IBM the nod, here.

Winner = IBM

Sustainable competitive advantages

To break the tie, we have the most important factor: sustainable competitive advantages -- often referred to as a moat. We'll deal with IBM first.

As I said, the company is slowly pivoting away from its mainframe business and toward Strategic Initiatives. While this older-line business isn't going away anytime soon, it's vulnerable to disruption when replacement cycles arise, and the competition has an opportunity to take business away from IBM. That's why -- even though the company's mainframe business is enjoying huge wins during the current cycle -- I'm wary of the sustainability of this business division's moat.

In essence, Strategic Imperatives is a cloud-as-a-service business that offers companies big data analytics and AI services. In theory, these services should have high switching costs (no one wants to migrate all that data to a different provider), and create network effects, as more data being fed into AI systems makes proprietary algorithms even stronger. Strategic Imperatives grew by 20% in 2017 to a run rate of $10.7 billion. Unfortunately, the segment doesn't report the kind of metrics -- like dollar-based expansion rate or revenue retention -- that let us see how sticky the service really is.

Oracle, on the other hand, is a leader in enterprise resource planning (ERP) software. Businesses use this software to sync all of their different operations on one platform. It's an incredibly important part of any business. Oracle offers many of its services -- cloud, platform, and infrastructure -- in an "X-as-a-Service" business model that benefits from the same high switching costs we talked about with IBM. These businesses also account for a larger portion of Oracle's sales than IBM's.

However, like IBM, the company doesn't provide detailed metrics on revenue retention, making it impossible to know if growth is coming via existing customers adding capacity, or new customers replacing old ones. Indeed, in the past two years, there have been reports that the stickiness of Oracle's solutions were far less than industry standards.

Without such clarity, it's difficult to call a winner, and I'm ending this as a tie.

Winner = Tie

And my winner is...

There you have it: two companies with moats that -- in theory -- should be strong. One company has a stronger balance sheet, the other has a more enticing valuation. Put it together, and you have a tie.

To be honest, I'm not a huge fan of either company. If you are interested in companies benefiting from the high switching costs and network effects associated with the software-as-a-service model, there are smaller players out there that publish results with far more granularity -- and have bigger opportunities -- that you can invest in. As such, I don't own either IBM or Oracle, nor am I willing to give either an "outperform" rating on my CAPS profile.

Teresa Kersten is an employee of LinkedIn and is a member of The Motley Fool's board of directors. LinkedIn is owned by Microsoft. Brian Stoffel has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Apple. The Motley Fool owns shares of Oracle and has the following options: long January 2020 $150 calls on Apple, short January 2020 $155 calls on Apple, and long January 2020 $30 calls on Oracle. The Motley Fool has a disclosure policy.