The technology world is being overtaken by a new business model: software-as-a-service (SaaS). In the past, you had to buy software from a company for a pretty penny, take it home (or to work), and go through the laborious process of installing it. If any updates occurred, you'd have to fork over all that money again 12 months later.

Today, SaaS has solved that by moving everything to the cloud. This ends up benefiting both end users -- who don't have to pay huge sums, install clunky programs, and repurchase every 12 months -- and software companies, who are can update things in real time, cut down on overhead costs, and lock customers in for the long haul via a subscription model.

Our two competitors today are vanguards of the movement: Shopify (NYSE:SHOP), which provides an e-commerce platform for merchants of all sizes, and Zendesk (NYSE:ZEN) -- a SaaS provider of customer-support software.

Diagram of SAAS use

Image source: Getty Images.

Which company is a better buy at today's prices? That's impossible to answer with 100% certainty. But by viewing the question through three different lenses, we can get a better idea of what we're getting when we purchase shares. Here's how these two stack up.

Sustainable competitive advantages

If you're a long-term, buy-to-hold investor, nothing is more important -- or difficult -- to investigate than an underlying company's sustainable competitive advantage. Often times referred to as a "moat," this is the special something that keeps customers coming back for more, year after year, while keeping the competition at bay for decades.

For SaaS companies, the moat is normally provided by high switching costs. Anyone who has all of the customer data on a single platform (Zendesk) would be loath to switch to a competitor. Not only would it be expensive, but it would dangerous in terms of losing customer information, and a headache in terms of retraining employees. That's why the company's dollar-based net expansion rate -- a measure of switching costs -- stood at 119%.

In plain English, this means existing customers not only stayed with Zendesk, but started using more of the company's solutions.

Shopify also benefits from those very same dynamics. A small business owner wouldn't want to spend any more time than necessary maintaining an e-commerce platform. The switching costs are just too high. That helps explain why Shopify's revenue grew 73% last year, and its monthly billing retention rate has been consistently over 100%.

But I would argue that Shopify's moat is wider for two reasons: first, I consider Atlassian to be a formidable foe for Zendesk because it offers a larger suite of solutions for companies. Further, Shopify benefits from enviable network effects: As more merchants flock to the platform, third-party app developers build solutions on Shopify's infrastructure. That draws even more merchants in, which incentivizes more app developers to join. It's a virtuous cycle that helps put Shopify on top.

Winner = Shopify

Financial fortitude

Shareholders of both Shopify and Zendesk understand they won't be seeing cash being returned to them in the form of dividends or aggressive share buybacks anytime soon. They are both in the phase where sales are plowed back into growth opportunities.

That being said, though, there's something important about keeping a boring old pile of cash on hand. That's because every company, at one point or another, is going to face difficult economic times. When those times hit, cash can actually make you stronger -- allowing you to acquire start-ups at a discount, bleed the competition dry by undercutting them on price, or even buying back shares on the cheap.

Keeping in mind that Shopify is valued at roughly three times the size of Zendesk, here's how the two stack up.

Company Cash Debt Free Cash Flow
Shopify $938 million $0 ($28 million)
Zendesk $344 million $0 $18 million

Data source: SEC filings. Cash represents cash as well as short- and long-term investments. Free cash flow presented on a trailing-12-month basis.

Both of these companies have superb balance sheets with absolutely no debt. Normally, I would give the nod to Zendesk, as it is free-cash-flow positive. But some perspective is in order: The only reason Shopify isn't in the same position is because it made aggressive investments in its Shopify Capital program. 

At the same time, the absolute level of Shopify's cushion is almost three times the size of Zendesk's, and I'm confident both companies would benefit equally -- relative to the competition -- if an economic crisis hit.

Winner = Tie

Valuation

Finally, we have the murky science of valuation. Because neither of these companies is profitable, and they are both relatively young, it can be very difficult to nail down how "expensive" each is. That said, here are three data points I like to use.

Company P/S P/FCF PEG Ratio
Shopify 20 N/A 29
Zendesk 10 236 38

Data source: Yahoo! Finance, SEC filings.

By almost all traditional metrics, both of these companies are very expensive. Shopify, though, appears to be more expensive. While it has a slight edge in terms of its valuation relative to growth (PEG ratio), both companies sport ridiculously high numbers. Zendesk trades at a 50% discount relative to sales and at least has the free cash flow necessary to give us a reading.

Winner = Zendesk

And my winner is...

There you have it: a tie! Whenever this is the case, I side with the company that has the stronger moat. In this case, that means Shopify. But don't be mistaken, I think both of these companies are worthy of your attention -- and I've put my skin in the game, as I own shares of both, and they occupy 7% of my real-life holdings. 

If you understand the business models, have a long-term time horizon, and can handle the volatility that comes with stocks with such high expectations, I think they're both worthy of your due diligence.

Brian Stoffel owns shares of Shopify and Zendesk. The Motley Fool owns shares of and recommends Atlassian and Shopify. The Motley Fool recommends Zendesk. The Motley Fool has a disclosure policy.