Database-disruptor MongoDB (MDB -0.76%) has been one of the hottest stocks in the market over the past few years. Though MongoDB has only been a public company for a little over two years, early believers have made very hefty gains.

Of course, MongoDB's success wasn't preordained. Several IPOs from the last year have drastically underperformed, despite sporting some similar characteristics. So how much money has MongoDB made for investors in its IPO? And what lessons can growth investors interested in new IPOs take away from its success?

Animated data icons illuminate the foreground and fade into a blue background.

Image source: Getty Images.

Fast money

MongoDB was founded in 2007 by DoubleClick founders Dwight Merriman, Eliot Horowitz, and Kevin Ryan, but went public on October 19, 2017 at $24 per share. On the first trading day, shares spiked 34% to $32.07 at the end of its first trading day after hitting an intraday high of $34.

Fast forward just two years and four months later, and MongoDB's stock sits at a whopping $172 per share as of this writing. That's over a seven times return in just over two years. If you had decided to make just a relatively modest $1,000 bet on MongoDB at its IPO, that stake would be worth $7,166 today. Even if you had "bought high" on the stock's first day of trading at $34, you still would have made over five times your money, or roughly $5,059.

Certainly, not all IPOs work out so well. In fact, many that came to market late last year are struggling, as investors began to take a closer look at new high-growth, money-losing companies. So how did MongoDB manage to reap such huge rewards for investors, where many other IPOs couldn't?

Enterprise software and databases are great businesses

First and foremost, MongoDB operates in the enterprise software industry, which is so attractive because it's largely a subscription-based, recurring-revenue business, leading to stable and growing sales. In addition, enterprise software tends to be fairly "sticky," whereby it's a real pain for large corporations to switch all of their employees onto a new format, retrain them, etc.

Software also tends to scale quite well and doesn't need lots of cash investments to produce -- just research and development for software engineers and sales and marketing agents. Therefore, tech software companies are quite high margin. MongoDB has gross margins in the low 70% range, though some larger software companies such as Alteryx have gross margins in the low-90% range.

In addition, the database is a particularly attractive product, even by enterprise-software standards, because it stores and organizes all or part of a large corporation's most important data. If a company wanted to switch vendors, it would have to lift all of that data from the old database and insert it into a new one. That's not only a huge pain; it's also terribly risky, should any data get lost. Therefore, most companies tend to stick with their database vendor over time, even if that vendor raises prices. That's how Oracle became such a tech powerhouse throughout the 1990s.

Finally, the database market is huge and growing. According to IDC, the global database market was $64 billion and is projected to grow at a 9.5% compound annual growth rate. Over the past 12 months, MongoDB has made just $383 million in revenue, compared to that massive and growing market opportunity.

Leading the disruptors

MongoDB set its sights on disrupting this massive market, and recent results seem to reflect its success in doing so -- though it still has far to go. The company was the inventor of the document database, an open-source technology that combines the security of traditional relational databases with the flexibility and scalability required of modern data applications.

Not only was MongoDB the innovator -- or at least the first to commercialize this new document-database technology -- it also had a first-mover advantage. That product lead, as well as the prominence and cash from going public in 2017, has given MongoDB a solid leading position in the market, attracting many top companies to try MongoDB as their next-gen modern-database solution.

Awesome execution

MongoDB has continued to innovate at a brisk pace since going public, expanding its cloud-based Atlas database-as-a-service product and adding many enterprise-grade features to its database capabilities. This includes the "Stitch" feature, which streamlines coding for application developers, and ACID compliance, which guarantees data integrity in many transactions-based businesses.

The rapid pace of innovation and product improvements has actually accelerated MongoDB's revenue growth. The company maintained a 52% growth rate last quarter, compared with 51% growth at the time of its IPO, more than two years prior. Keeping revenue growth that high and accelerating over several years shows that customers are taking up MongoDB's offerings at an exponential rate.

MongoDB's stellar execution, first-mover advantage in a disruptive technology, and being in a large, attractive industry are the reasons the company's stock has crushed the market over the past two years. This is why it remains one of the best growth stocks around today.