Software as a service (SaaS) is the dominant tech trend over the last several years, and it's likely to continue dominating over the next several years.

We're in the midst of a changing of the guard, when many of the big software companies are being replaced by young, fast-growing upstarts. This is happening across the software gauntlet, including customer relationship management software, database software, collaborative software, analytical software, procurement software, security software, and more.

The five tech stocks on this list are all fast-rising SaaS companies. While megacaps Amazon and Microsoft have had very nice growth providing web service platforms for SaaS, neither of these companies is on the list. Rather, the stronger plays are smaller internet companies that are using their platforms to provide software cheaply and easily to enterprise clients.

SaaS, arguably the strongest of all sectors, is a wonderful place for investors to be. Without further ado, here are the top five SaaS stocks to buy for 2020, in alphabetical order.

A 3D bar chart with an arrow going up and the number 2020

Image source: Getty Images.

Datadog

Datadog (NASDAQ:DDOG) is the most expensive stock on this list, and with good reason. The analytics and monitoring company trades for 35 times its sales. While that's a very high price, the company had $96 million in revenue for the quarter, up 88% from this time last year. And its gross margin was 76%. As for profitability, the company broke even on a non-GAAP (adjusted) basis.

While the astounding sales growth number is what gets headlines, perhaps the coolest financial number is one specific to SaaS companies: Datadog's dollar-based net retention rate was 130%. That means that the company kept 100% of its subscription revenue from the previous year, and added another 30% of revenue from existing clients.

MongoDB

MongoDB (NASDAQ:MDB) is the giant-killer that's taking on Oracle, and is winning. Mongo specializes in providing database software for unstructured data, which is a huge category many times larger than traditional SQL databases that just hold spreadsheets (Oracle's domain). MongoDB's NoSQL database software organizes spreadsheets, yes, but also all the data that's not in spreadsheet form -- in other words, most of the data in the world.

Mongo's numbers are quite good, but what's really stellar is its SaaS offering, Atlas. The company introduced the cloud offering three years ago. Now it's a business with a $175 million annual run rate, growing revenue 185% in the most recent quarter. This fantastic growth is quite promising, as MongoDB is taking market share in the huge ($64 billon) database market. It's also the cheapest SaaS stock on this list, trading at 19 times sales.

Shopify

Shopify (NYSE:SHOP) is in a class by itself: What other company has taken on Amazon and won? Shopify provides software services to retailers that want to become online merchants. Amazon tried to enter this business, but in 2016 the internet giant surrendered and ceded the field to Shopify. Yes, the $45 billion SaaS juggernaut vanquished the $884 billion e-tailing giant.

Consider how vast the market is for internet retail. Shopify recently celebrated its one millionth customer win. The company has an entire ecosystem of subscribers, and it's still growing (revenue is up 44% year over year). Shopify is almost as expensive as fast-growing Datadog, with a price-to-sales ratio of almost 32. Yet this high multiple is probably warranted: Shopify enjoys a near-monopoly in what it does, and the company still has a huge runway of growth ahead, with a market opportunity of $70 billion.

Smartsheet

Smartsheet (NYSE:SMAR) is a fascinating SaaS company that has a collaborative software offering. Collaborative software has always been a niche market; in the old days, everybody had to install the software in order to collaborate. Those days are gone. Now, individuals can download the software and try it out; people who don't subscribe to Smartsheet's offerings can collaborate with people who do.

Like most SaaS companies, Smartsheet has a "land and expand" strategy -- if a few people in an enterprise try the software, the number of subscribers multiplies from there. Smartsheet's dollar-based net retention rate is 134%, and its revenue is growing by 54% year over year. The company is creating a new market, replacing some of the myriad ways people communicate and share information on a project. What used to be a mishmash of emails, phone calls, whiteboards, and face-to-face meetings now takes place on a collaborative platform.

Zoom Video Communications

Zoom Video Communications (NASDAQ:ZM) rivals Datadog for both the fastest-growing SaaS stock, and the most expensive. In the most recent quarter, sales jumped 85% to $167 million. Gross margin was almost 83%. Maybe the most amazing thing about Zoom is that it achieves these growth rates while remaining profitable.

Zoom is competing with legacy players like Cisco and Microsoft, and is taking market share from them with its best-of-breed offering. So far, videoconferencing has been a disappointing market opportunity, with buggy systems that annoy the people who try to use them. But Zoom's motto is: "It just works." This market opportunity is at least $43 billion, but probably higher, as videoconferencing is far more popular when the technology works.