Investing in small-cap stocks isn't for everyone. By their very nature, these companies have the deck stacked against them. In the real world, the Davids (small caps) usually lose to the Goliaths (well-funded megacaps).

But every now and again, a small-cap stock breaks through. When it happens, the financial gains are enormous. Case in point: Netflix was a $1 billion company in 2003. Today, it stands at over $140 billion. A $10,000 investment is now worth $1.4 million.

Today, I'll introduce three small-cap stocks ($5 billion or less in valuation) to consider buying heading into 2020. All three use the powerful software-as-a-service (SaaS) business model and are carving out potentially dominant positions in their niches. Who knows where they'll be 10 years from now?

Cartoon of David defeating Goliath

For these small caps, it's often a game of David vs. Goliath. Image source: Getty Images.

Making spreadsheets better

You have to give it to Microsoft. The fact that Excel spreadsheets are still as widely used today as they were 20 years ago says something about their utility. But eventually, someone had to come along and improve upon the concept. I believe that "someone" is Smartsheet (NYSE:SMAR).

The twist is that Smartsheet can take unstructured data from emails, phone calls, face-to-face meetings, and -- yes -- spreadsheets and accumulate it all under one umbrella. That type of solution helps employees organize information and analyze it in ways that weren't possible before.

The company is growing its business thanks to an underappreciated network effect. Perhaps a small division at a company tries Smartsheet. Once they see how well it works, management spreads it companywide, leading to much more subscription revenue for Smartsheet.

The best way to monitor the company's progress is via its dollar-based net retention (DBNR). This measures how much subscription revenue one cohort of customers pay from year to year, while filtering out the effect of new customers.

DBNR at Smartsheet over time

Data source: SEC filings. 2019 figures accurate as of Oct. 31, 2019. Chart by author. 

This means that customers are not only sticking with Smartsheet (which would be reflected in DBNR near 100%), but they are adding more and more users every year. That and high switching costs create a moat, which is important, as the $5 billion company has to fend off the likes of Microsoft. If it succeeds, today's price will look like a bargain.

Starting small and growing in multiple niches

Software company AppFolio (NASDAQ:APPF) got its start when two Santa Barbara entrepreneurs noticed something funny: Regular people were adopting cloud solutions faster than businesses. Twenty years ago, if you sent yourself an email with an attachment so you could print it off at the library, you were using the cloud.

Klaus Schauser and Jonathan Walker saw the potential for businesses to use the cloud. They decided they'd team up and focus on cloud solutions for very specific industries. It started first in property management -- with tools that help track leads, run background checks, and offer tenant liability insurance. Via acquisition, it also has software solutions for small law firms.

Using DBNR again, you can see that both businesses are solid.

DBNR in AppFolio's two verticals over time

Data source: AppFolio investor relations. Chart by author. 

As with Smartsheet, existing customers are not only staying with AppFolio, but using more of the company's Value+ services over time. The company has also made acquisitions recently to bolster its offerings, which will help clients use artificial intelligence in managing their properties.

All told, AppFolio has done a great job of providing solutions to small and underappreciated industries. This focus will help it not only grow within these smaller industries but look for opportunities to branch out in the decade to come.

Writing the book on the subscription economy

The subscription economy is a huge trend. Instead of owning things, we just want access to them. It feels more affordable, is less of a hassle, and simplifies our lives. Just ask any city dweller who has made the successful transition from car owner to Uber/Lyft user.

But the accounting needed for subscription companies is a different animal altogether. Tien Tzuo founded Zuora (NYSE:ZUO) when he realized this disconnect while working for Zuora's software helps companies make the transition from one-off purchases to subscriptions -- and the requisite regulatory changes in accounting.

The company went public in 2018, but shares are still at their IPO levels. Much of that has to do with growing pains: sales troubles in convincing companies to switch to a subscription model and integration issues with the company's RevPro product.

My bet on Zuora has yet to be vindicated, but two things give me solace: Tzuo is an evangelist of the subscription movement. He literally wrote the book on it: Subscribed. Second, I think the benefits of access (read: subscriptions) over ownership are undeniable, and will only continue to be more important. So I think companies will need Zuora's software eventually, and buying the $1.6 billion company today seems like a fair deal.

What I'm expecting from these small-caps

As cheery as all of this sounds, it's important to remember that the Davids usually lose to the Goliaths. It's vitally important not to invest more than you're comfortable with in such smaller companies.

In my own portfolio, these three names combined account for just 5% of my family's holdings. If they end up losing their battles, I can swallow that. If they end up being huge successes, such exposure will be more than enough to help meet my family's investment goals.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.