Like a lot of software-as-a-service (SaaS) companies, MongoDB (NASDAQ:MDB) stock had an amazing run in 2020. The non-SQL database company rose 173%, outpacing the total return of the S&P 500 (up 18%) and NASDAQ-100 (up 49%). While investors ought to be happy with the performance, they likely are asking themselves whether shares are getting ahead of the underlying business.

Is MongoDB still a buy, or is it overvalued? Let's investigate.

A man sitting at a table, leaning into his hand as he talks to someone else on the other side of the table

Image source: Getty Images.

How the business is doing

SQL (structured query language) databases were developed in the 1970s with the goal of reducing data duplication, which was a big deal at the time. Oracle is an example of a company with an SQL database product. While not as efficient data-wise as an SQL database, non-SQL products like MongoDB's are easily scalable and provide more flexibility for users. With storage getting cheaper over the years, developers have slowly switched over to non-SQL products.

Last quarter, total revenue for MongoDB grew 38% year over year to $151 million and it had 22,600 paying customers as of the end of October, up 42% year over year. MongoDB Atlas, the company's cloud database service, grew sales by 61% in the quarter and made up 47% of sales. Atlas has been MongoDB's main growth driver the last few years, and for good reason. The service is cloud-based, making it a lot easier to use in a work-from-home environment. It also scales across the three big cloud providers -- Amazon's AWS, Microsoft's Azure, and Alphabet's Google Cloud -- giving developers more flexibility than if they were to get hosting strictly from one service.

Another reason MongoDB has done so well is its freemium model, which allows anyone to download its applications on their device, albeit with limited functionality and storage compared to the paid tier. This open-source mindset has led MongoDB to dominate mindshare in the developer community. The company has also had objective success and on a Dec. 8 conference call, CEO Dev Ittycheria said, "by every objective measure, MongoDB is the most popular modern database in the world today."

The free tier had been downloaded over 55 million times through the first three quarters of 2020, and had 130 million cumulative downloads at last report. It is evident that a minority of these downloads have transitioned to paying customers, however, investors should be thinking of these downloads as a cheap educational tool, as they help teach developers how to use the product. Then, when someone is ready to graduate to a paid database solution, they are (theoretically) more likely to use MongoDB.

However, MongoDB is still hemorrhaging money, with a $72.7 million net loss last quarter. However, it only had $15 million of negative free cash flow, meaning that while it was forced to recognize over $70 million in "losses" according to generally accepted accounting principles, only $15 million actually went out the door. This occurs because MongoDB has to count non-cash expenses like stock options and depreciation against its earnings, which makes it seem like the company is losing more money than it actually is.

What to think of the valuation

Trading around 35 times sales (market cap divided by last 12 months revenue), MongoDB is not cheap. As a reference, the average enterprise software company trades at a P/S of 8.2. Investors do have a right to be confident in this business. It has high gross margins, has grown sales in the high double digits for many years, and has a $54 billion market to go after. But no matter how great this business is or will be, a sales multiple over 30 seems to be a bit much.

Software developers aren't cheap either. And in order to retain and recruit highly sought-after talent, companies like MongoDB reward employees with stock options. This can lead to high levels of share dilution. For example, over the past year, MongoDB's shares outstanding have grown by 5.2%. Why does this matter to investors? Because even though MongoDB's sales grew 38%, that growth was spread out over a larger shareholder pie.

Overall, investors should be excited about MongoDB's, especially Atlas', business prospects. With only $150 million in revenue last quarter, a killer product, and a gigantic market opportunity, I would not be surprised if the company had three or even four times its annual sales five years from now. The problem is, with its current nosebleed valuation, it looks like the market has priced in much of this growth. Investors should refrain from buying MongoDB unless this changes.

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.