In Warren Buffett's 1993 shareholder letter, the legendary value investor cited this quote: "In the short run, the market is a voting machine [...] but in the long run, the market is a weighing machine." In other words, volatility is unavoidable. At times, great companies may lose a significant portion of their value, and not-so-great companies may achieve absurd valuations, but time is the great equalizer. As years pass, the great companies will outperform their peers.

Given the recent market volatility, I think that quote is particularly timely. It serves as a reminder to look beyond the here and now, and invest your money in high-quality stocks that you plan to hold for years or even decades. Doing so helps eliminate the impact of short-term volatility, and it gives your investment thesis plenty of time to play out.

Building on that idea, I think DigitalOcean (DOCN 3.26%) and MongoDB (MDB 4.51%) could grow fourfold in the next decade, a pace that would turn $250,000 into $1 million. Here's what you should know.

Suited man seated at his desk, contemplating content on his computer.

Image source: Getty Images.

1. DigitalOcean

DigitalOcean specializes in cloud computing. Whereas tech titans like Microsoft and Amazon tailor their products to the needs of large enterprises, DigitalOcean focuses on small- and medium-sized businesses (SMBs) and individual developers. More specifically, the company focuses on simplicity. Its click-and-go interface makes it possible to provision cloud services within minutes, without any specialized training.

The company also provides 24/7 technical support, an extensive library of tutorials, and performance monitoring tools free of charge. Collectively, its cloud platform helps clients build and scale applications quickly, while eliminating the need to invest in costly on-site hardware. And that value proposition has translated into strong demand.

In the third quarter, DigitalOcean grew its customer base 7% to 598,000, and the average customer spent 16% more with the company. That compounding dynamic helped DigitalOcean report revenue of $111.4 million in the quarter, up 37% year over year. And cash from operations surged 73% to $40.3 million, meaning DigitalOcean is making enough money to pay the bills.

Currently, there are 100 million SMBs in the world, and 14 million new businesses are started each year. To that end, management estimates its addressable market will reach $116 billion by 2024. More importantly, DigitalOcean's developer-first business model is a big selling point, and it should bring more clients to the platform in the years ahead.

For that reason, I think this $7.5 billion company can grow fourfold (or more) in the next decade.

Software developer analyzing data on her computer screen.

Image source: Getty Images.

2. MongoDB

A database is at the heart of every application. This is where data is stored, organized, and accessed when it's needed. Legacy platforms relied on a relational model, requiring developers to format data into structured rows and columns. But 80% to 90% of data generated by modern applications is unstructured, such as videos posted to YouTube, photos shared on social media, and comments left on websites.

This type of data doesn't fit neatly into rows and columns, meaning it would be tedious for developers to maintain such a system. That's why MongoDB built a modern, general purpose database. Its platform uses a document model, allowing developers to store huge amounts of unstructured data. That flexibility drives productivity and efficiency, meaning clients can build and scale products more quickly. Compared to legacy solutions, MongoDB believes its software makes development three to five times faster and 70% less expensive.

Not surprisingly, the company has garnered a following in the developer community. In fact, it's the most popular non-relational database and the fifth most popular database of any kind, according to DB-Engines. Not surprisingly, that edge has translated into rapid growth.

In its fiscal third quarter, MongoDB's customer count grew 37% to over 31,000, and 1,201 of those customers now spend over $100,000 on an annualized basis. Additionally, the company's revenue expansion rate came in above 120%, meaning the average customer spent at least 20% more over the past year. In turn, revenue rose 50% to $226.9 million. And while MongoDB posted negative cash from operations of $5.8 million during the period, that figure marks an improvement over the prior year. More importantly, with $1.8 billion in cash and short-term investments on its balance sheet and just $1.1 billion in long-term debt, MongoDB can afford to continue investing in its growth.

Looking ahead, the company has plenty of room to grow. According to the International Data Corp., the data management software market will reach $121 billion by 2025. And given MongoDB's strong competitive position, I wouldn't be surprised to see its market cap grow at least fourfold over the next decade as well.