Earlier this year, you probably wouldn't have guessed that MongoDB (MDB -0.23%) was a market-beater in the making. Over a period of less than four weeks between mid-February and mid-March, MongoDB lost more than 45% of its value. From its bottom, however, the stock has come roaring back, gaining more than 100%. In the process, it has become one the best performing stocks of 2020 to date.

This raises the inescapable question among investors who feel the train has already left the station. After such a spectacular run, should investors consider adding MongoDB stock to their portfolio right now, or should they look for better opportunities elsewhere?

Man in a business suit carrying a large burlap sack with a dollar sign.

Image source: Getty Images.

Disrupting the database market

While many things have evolved in the cloud era, the humble database remained stuck in the past, unable to accommodate data that doesn't fit neatly into rows or columns. Over the past decade, MongoDB sought to change that with its non-relational database, which can store all types of electronic information, including photos, audio, social media posts, video, and even full documents with its innovative cloud-based solution.

The company isn't lacking for competitors in the space, with such notable rivals as Oracle, International Business Machines, and Microsoft, and those are just the legacy database providers. MongoDB also competes with a host of smaller non-relational database software providers. 

While MongoDB isn't a household name, its customer list reads like a who's who of corporate glitterati, including such well-known companies as Adobe, Alphabet, Verizon, and PayPal, just to name a few.  

MongoDB offers a free-to-use version of its flagship database, which has been downloaded more than 90 million times since it was introduced in 2009, and over 35 million times during the past year alone. After experiencing the usefulness of MongoDB's product firsthand, developers often sign up for Mongo's cloud-based, fully managed, database-as-a-service product: Atlas.

Even the outbreak of COVID-19 didn't slow MongoDB's growth, and may have accelerated the digital transformation, which will benefit the company over the long run.

Man's hand typing on a laptop with digital images appearing above.

Image source: Getty Images.

Impressive quarterly results

In the first quarter, MongoDB's revenue grew 46% year over year, while the company continued to generate manageable losses. On a non-GAAP (adjusted) basis, the company cut its losses by about 40%. This was partially the result of impressive growth in its customer base, which grew to 18,400, up 30% year over year. Even more impressive was the growing adoption of Atlas, as its customer count grew by 37% to 16,800.

While the company continues to add new customers, existing customers were also spending significantly more. MongoDB's net annualized recurring revenue (ARR) expansion rate stayed above 120%, which means existing customers are spending 20% more than they did this time last year. Customers spending more than $100,000 annually also grew by 30%.

Other important considerations

MongoDB has about $977 million in cash and short-term investments on its balance sheet and about $923 million in debt. It's worth noting, however, that the debt is convertible to equity, so it represents less of a financial risk. 

It's also important to note that executive officers and directors of MongoDB still own 81% of the class B shares and control nearly 56% of the voting power, so their interests are clearly aligned with those of ordinary shareholders.  

A man working on a tablet producing a cloud computing image and various graphs.

Image source: Getty Images.

Valuation

Then there's the matter of the company's valuation. Since MongoDB debuted in late 2017, it has risen more than 500%, so the stock is by no means cheap. In fact, it's just the opposite. As of Wednesday's close, the company's forward price-to-sales ratio has grown from low double digits in late March to more than 22 now -- when a ratio of between 1 and 2 is considered good -- so investors have clearly baked an hefty amount of growth into MongoDB's current share price. 

To put that into perspective, analysts are expecting sales growth of 28% in the current quarter, 26% for the current year, and 29% next year -- though MongoDB has frequently exceeded expectations.  

The bottom line

Which brings us back to the seminal investing question: "Is MongoDB stock a buy right now?" As with so many things, the answer is: "It depends." And much of the answer for you will depend on who you are as an investor.

If you're an investor who's not the least bit interested in a stock with a high valuation, if you steer well clear of issues that are characterized by excess volatility, or you're just looking to make a quick buck, then MongoDB probably isn't the stock for you.

If, however, you're willing to accept a high valuation and an even higher sticker price for the right set of growth drivers, if you can handle the inevitable stomach-churning peaks and valleys that are sure to come in the months and years to follow, and have an appropriate three- to five-year time horizon, then MongoDB might just be at home in your portfolio.