You want amazing returns? Few investors have experienced a two-year run on par with those holding shares of e-commerce platform Shopify (NYSE:SHOP) and/or customer-service software provider Zendesk (NYSE:ZEN). Both companies have tripled in value over that time frame.

A huge factor in that growth is the power of the software-as-a-service (SaaS) model being adopted by these two companies. It's a trend that is only becoming more prevalent as time goes on.

A businessman's hand pushing a cloud icon on a screen

Image source: Getty Images.

Between the two, which is a better buy today? We can't know that answer with 100% certainty. But by comparing the companies on three different dynamics, we can get a better idea for which we'd feel more comfortable putting our money behind.

Check out the latest earnings call transcript for Shopify and Zendesk.

Financial fortitude

When evaluating financial fortitude, what I'm really wondering is this: Which of these two companies would fare better if an economic crisis hit today?

I'm not just talking about surviving -- I'm talking about actually getting stronger. While the stock price might suffer, a company with lots of cash and little debt can capture long-term market share as weaker players bow out during a recession.

Keeping in mind that Shopify is valued at two-and-a-half times the size of Zendesk, here's how the two stack up.

Company Cash Debt Free Cash Flow
Shopify $2,000 million $0 ($19 million)
Zendesk $821 million $458 million $43 million

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

Both of these companies have strong balance sheets, but I'm going to side with Shopify. Here's why: The company's negative free cash flow is almost entirely by design -- it doesn't want to hit the brakes on reinvestment too early. There's tons of market share to gain. If an economic crisis hit, Shopify could tap the spending brakes and be cash flow positive if it wanted to.

Thus, the fact that Shopify has a net cash position of $2 billion, versus Zendesk's $360 million, gives it the edge here.

Winner = Shopify

Valuation

Next, we have valuation. This is part art, part science. But as you'll see below, both of these stocks can be summed up in one word: expensive.

Company P/E P/FCF P/S PEG Ratio
Shopify 564 N/A 20.9 8.0
Zendesk 335 202 14.6 5.4

Data source: Yahoo! Finance, E*Trade. P/E calculated using non-GAAP earnings.

Anyone who has a value-investing bone in their body would likely faint from such numbers. It is very rare to find companies trading for 300 to 500 times earnings.

This, however, is also by design. Both of these companies have wide moats (more on that below) from high switching costs. The recurring revenue that they take in is very reliable and unlikely to disappear. In fact, spending per customer usually grows over time.

That assurance encourages management teams to invest in long-term growth and profitability at the expense of short-term concerns. Therefore, earnings are sparse, for now.

Both stocks are expensive, but Zendesk is technically "cheaper."

Winner = Zendesk

Sustainable competitive advantages

Finally, we have to evaluate the most important factor: a company's sustainable competitive advantages -- or its moat. Both of these companies benefit from a primary moat of high switching costs.

If an e-commerce start-up (and that's what almost every start-up in retail is these days) wants a platform to operate on, Shopify is the go-to choice. Once everything is up and running -- a website, payment solution, order tracking, analytics, etc. -- a vendor would be loath to switch to a different platform. Doing so would incur both financial and emotional costs.

The same is true for Zendesk. Most customers get started with Zendesk Support, but then add on other tools over time -- like Chat, Talk, Guide, and Support. This is evidenced by the company's dollar-based net expansion rate of 119%. In essence, this means Zendesk customers are not only sticking with the company but spending 19% more every year.

But the differentiator here is the fact that Shopify has a second powerful moat starting to form around it: network effects. As I recently covered in an article on the topic:

Shopify now has around 2,200 apps available in its app store. It only keeps a 20% cut of sales of those apps -- not a huge needle mover. But that's not the point: They make the platform more valuable -- and Shopify doesn't have to do much of anything.

Shopify currently has over 800,000 merchants on its platform. That means more third-party app developers will build up Shopify's base. That, of course, will only draw in more merchants. That provides a solid second moat for Shopify, and gives it the edge here.

Winner = Shopify

And my winner is...

So there you have it: Shopify is my winner. But don't shy away from Zendesk, either. I own both stocks in my own portfolio -- and they comprise 10% of my real-life holdings. I think both are worthy of your consideration. If you have to choose one to start with, though, make it Shopify.