Shares of database software specialist MongoDB (NASDAQ:MDB) have gained 159% over the last year. Is the stock in the middle of a long bull run or is it due for a correction in the near future? Let's find out.

First things first

I do have a dog in this race, having picked up a few MongoDB shares near the market bottom in March.

The stock struck me as incredibly affordable at the time since MongoDB's NoSQL databases are perfectly suited for exactly the type of data people are storing these days. NoSQL databases are great at organizing unstructured data from diverse and sometimes unreliable sources such as user input in smartphone apps, sensor readings from fitness trackers and Internet of Things devices, or any type of large data collection for a business app whose data requirements are constantly changing.

So far, my investment thesis has played out very nicely. On a year-over-year basis, MongoDB's trailing sales jumped 41.5% higher in the third quarter. The company is not moving any closer to bottom-line profitability, but that's by design because MongoDB's management prefers to reinvest spare cash into marketing, software development, and other growth-promoting projects. Either way, quarterly results continued to beat the Street's consensus estimates across the board all year long. And my MongoDB shares have more than tripled in value since March, posting a total gain of 227%.

A young woman squints in deep thought, tapping a pencil on her chin.

Image source: Getty Images.

Is it time to sell yet?

To everything (turn, turn, turn), there is a season (turn, turn, turn). I always plan to hold the stocks I buy for several years and sometimes even decades, but changing market conditions and skyrocketing (or diving) share prices can change my plans along the way. Since MongoDB has produced a handsome profit by delivering on its short-term promises in 2020, there might be a world in which I'm selling MongoDB right now.

This stock is mighty pricey, after all. The rapid climb in 2020 put MongoDB in Wall Street's nosebleed seats, valued at 40 times trailing sales and nearly 1,000 times the company's book value. All the profit-based valuation metrics are useless here because of MongoDB's consistently negative profits.

Or maybe even time to buy?

But MongoDB's revenue growth is a thing of beauty, and that's the only support these sky-high share prices really need at this point in the company's history.

MDB Revenue (TTM) Chart

MDB Revenue (TTM) data by https://ycharts.com">YCharts

Build an undeniably massive user base now, then slow down the growth-hunting business practices while providing a broader range of high-margin products and services later on. That's the standard playbook of high-growth businesses and MongoDB most certainly holds a membership card to that club. It takes some time, a bit of luck, and honestly a fair amount of faith in the fast-growing company's strategy, and failure to reach the profit-seeking tipping point can be the death of the company.

That endgame would surprise me in MongoDB's case. The company is an established leader in NoSQL databases, which are turning the enterprise software world on its head. Relational database leader Oracle (NYSE:ORCL) boasts an annual revenue stream more than 70 times MongoDB's, and some would argue that all of Oracle's sales are up for grabs during the NoSQL revolution. On top of that, Oracle is nibbling at MongoDB's heels with a NoSQL product of its own, which is "designed for today's most demanding applications that require low latency responses, flexible data models, and elastic scaling for dynamic workloads" in Oracle's own words.

Let me point out that Oracle's sales have grown at an annual rate of just 0.4% over the last five years. Over the same period, MongoDB's revenues surged 59.6% higher per year. The elephant is chasing the mouse, and I think I know who will win in the long run.

A young woman wearing a red bowtie and white shirt draws an innovation-powered rocket on a large chalkboard.

Image source: Getty Images.

What's the verdict?

I see no reason to cash in my MongoDB winnings yet. Letting winners continue to win is an important credo of The Motley Fool's famous Rule Breakers newsletter, and I think we'll see a lot of winning in MongoDB's long-term future.

MongoDB shares may be a bit too rich for your blood, but you can't argue with the company's real-world business success and that's what successful investing is all about. You can wait for a pullback before starting a position in MongoDB but you might be left behind if the stock just keeps climbing -- which is a very real possibility.

So yes, MongoDB is a solid buy today, especially if you haven't started a position in this fantastic stock yet.

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.