I used to buy and sell stocks often. Over time, though, I found that frequent trading in and out of stocks hurt my overall returns. In retrospect, I would have been better off holding on to stocks longer. So now I typically hang onto stocks for at least a few years and sell only when I think the underlying reasons I bought a stock in the first place have changed. 

My reason for telling you all this is that this approach requires me to be very picky about the stocks that I buy. I like a lot of stocks, but I can't afford to invest in all of them. My portfolio currently primarily includes large-cap stocks. The greatest winners, though, tend to be stocks with smaller valuations that have a lot of room to grow.

There's one stock in particular that I have my eyes on right now. It's relatively small, is generating fantastic growth, and appears to have a huge runway for even more growth. If I could buy only one stock, it would be MongoDB (NASDAQ:MDB). Here's why.

Businessman touching technology icons

Image source: Getty Images.

Thanks, Google

MongoDB might not exist if it weren't for Google, now a subsidiary of Alphabet. In 2007, Google acquired internet advertising company DoubleClick. The deal opened the door for one of the founders of DoubleClick along with the company's former CEO and former chief technology officer to pursue an opportunity they'd had in the backs of their minds for a while -- developing a database to meet the needs of the modern world.

With plenty of cash and a great idea, Dwight Merriman, Eliot Horowitz, and Kevin Ryan founded a company initially named 10Gen. In 2013, they changed the name of the company to MongoDB. In case you're wondering, "mongo" is short for "humongous." The founders knew that their database had humongous -- mongo -- potential. They were right. 

MongoDB opted to make its basic database free to users. The company only charged for premium features and services. This approach led to MongoDB (the database) gaining tremendous popularity among developers. The database platform has been downloaded more than 35 million times. MongoDB (the company) now has more than 6,600 customers in over 100 countries.

The "freemium" model has worked really well. When MongoDB reported its fiscal 2018 first-quarter results in June, its revenue totaled $48.2 million, a 49% year-over-year jump. The company has increased revenue by a compound annual growth rate (CAGR) of more than 50% over the last three years.

A fast-growing market ready to be disrupted

What I like even more than MongoDB's strong track record so far is its potential to grow much larger. Despite its stock soaring nearly 130% since the company's initial public offering (IPO) in October 2017, MongoDB's market cap of $3.7 billion is still relatively small.

The global database market totaled $44.9 billion in 2016. By 2020, the market is estimated to be more than $63 billion. Data is the fuel driving artificial intelligence (AI) applications and advanced business analytics. And increased use of Internet of Things (IoT) devices and applications could really cause the amount of data needing to be stored to explode.

However, databases sold by leading companies such as Oracle (NYSE:ORCL) and Microsoft (NASDAQ:MSFT) are based on technology invented decades ago. These databases were designed for structured data stored on-premise at customer locations. That's not the world of data today. Massive amounts of both structured and unstructured data need to be stored and accessed, ideally from anywhere -- locally, in a private cloud, or in a public cloud. MongoDB's database was designed from the ground up to address these needs of today.

The database market is growing rapidly and is ripe for disruption. I think that MongoDB will be the most successful disruptor of all for a couple key reasons. First is the company's database technology. There are other databases designed for unstructured data, but MongoDB is the most popular database among developers -- and that's an important advantage.

Another big edge for MongoDB is its network of partners. I especially like that the company has teamed up with seven of the largest systems integrators in the world. Big corporations often turn to these major systems integrators to implement new technology. Their relationships with MongoDB could open up new opportunities for the company.

Risk vs. reward

I've only mentioned the good stuff about MongoDB so far. However, there are several risks for the company.

Big database vendors like Oracle and Microsoft aren't going to sit idly by while MongoDB takes away their market share. These companies have enormous financial resources to develop competing technology. 

MongoDB also still isn't profitable. The company lost more than $29 million in its latest quarter. Unfortunately, its bottom line isn't trending in a positive direction yet. MongoDB does have plenty of cash -- $271.5 million in cash, cash equivalents, short-term investments, and restricted cash at the end of April. However, it won't be able to lose money indefinitely before having to raise more cash through taking on debt or conducting a stock offering.

I still like the risk–reward proposition offered by MongoDB, though. The company should continue to grow by leaps and bounds. I think it will capture an increasingly higher market share in the expanding database market. It wouldn't surprise me if one of the big database companies decided to acquire MongoDB as a way to head off the threat.

MongoDB is investing heavily in marketing and development right now. However, that's a smart strategy in my view. It's only a matter of time before the company is profitable. When that day comes, I fully expect MongoDB to generate impressive earnings.

MongoDB picked a good name for itself. Its potential truly is mongo. 

Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Teresa Kersten is an employee of LinkedIn and is a member of The Motley Fool's board of directors. LinkedIn is owned by Microsoft. Keith Speights owns shares of Alphabet (A shares). The Motley Fool owns shares of and recommends Alphabet (A shares), Alphabet (C shares), and MongoDB. The Motley Fool owns shares of Oracle and has the following options: long January 2020 $30 calls on Oracle. The Motley Fool has a disclosure policy.