The downturn in the markets has many people doubting whether they will meet their retirement goals. But growing your money through the stock market simply boils down to owning shares in a group of companies that grow over many years. As Benjamin Graham, the mentor of the world's most famous investor Warren Buffett, once said, "In the short run, the market is a voting machine, but in the long run, it's a weighing machine."

If you invest $300 per month and earn an average annual return of 12% on your investments, you will have slightly over $1 million in 30 years. The market has averaged close to 10% per year over the last 50 years, so to beat the market, we need to look for companies with above-average growth prospects.

It's equally important to choose companies with a competitive advantage. This factor increases the chance that the stock you buy will continue to compound in value for a long time. What follows are two stocks with these qualities that would make good candidates to dollar-cost average into over the long term.

Invest in the leading travel booking platform

With the travel and tourism market expected to grow at 8.5% annually through 2026, Airbnb (ABNB -1.68%) is in a great position to deliver a higher compound annual return than that growth rate. Airbnb has been gaining market share for years and should continue to grow faster than the industry. Airbnb could grow its revenue at a mid-teens annualized rate over the next decade, setting the foundation for similar shareholder returns.

Airbnb was growing revenue above 30% year over year before the pandemic, and it's picking up where it left off. It reported 103 million nights and experiences booked on the platform in the second quarter. That represents a compound annual growth rate of 24% over 2019 levels.

Because technology is in Airbnb's DNA as an online exchange connecting hosts with guests, its tech-savvy approach to operating the business gives it an advantage over big hotel companies. For example, when demand took off last year coming out of the pandemic, the company was quick to release helpful new features, such as Flexible Dates and Flexible Destinations, to make it easier for people to discover the perfect spot to travel.

The best thing about Airbnb's business is that it is only scratching the surface of its growth potential. Management has previously mentioned expanding into other services over time -- possibly hotels, flights, and more. But given the $2 trillion opportunity in short- and long-term stays, Airbnb has enough growth in its core offering to deliver the returns investors need to hit millionaire status in 30 years.

The key stock to buy in the $1 trillion advertising market

Another growth stock to add to your millionaire-making portfolio is The Trade Desk (TTD -2.47%). This leading demand-side advertising platform has grown revenue about 10-fold since 2015. With under $1.4 billion in annual revenue, The Trade Desk has a massive runway for growth. Despite the recent weakness in the advertising market over a softening economy, advertising is an opportunity quickly approaching $1 trillion. Much of that annual spending is shifting toward digital media platforms, such as connected TV, where The Trade Desk already has a strong foothold.

The company offers a cloud-based platform that works with agencies and companies to place the appropriate ad in front of the right person at the right time. Its Unified ID framework has gained traction for helping advertisers target individual users without the privacy-invasive use of cookies, which have been the standard mechanism with which advertisers track consumers across the internet for many years.

The Trade Desk holds key advantages over the competition. Unlike Alphabet's Google, which makes most of its money from advertising, The Trade Desk doesn't acquire ad inventory to resell. Trade Desk is only in business to help companies manage their campaigns, eliminating any conflicts of interest with clients. The company makes money from charging a fee based on the amount spent on advertising over its platform.

The Trade Desk was early to recognize the opportunity in streaming media and has become a key partner for companies, including Walt Disney, looking to market their brands in front of a growing digital audience. With Netflix and other streaming services considering the move to ad-supported streaming plans, The Trade Desk should see its growth opportunity explode over the next few years.

The global ad market is expected to grow at a compound annual rate of nearly 8% over the next five years. Given The Trade Desk's record of robust growth and market differentiation with its independent platform, revenue should continue to grow faster than the ad market as it continues to gain companies' trust. Investors have a good chance of earning a 12% compound annual return over the long term by regularly adding money to this emerging growth tech stock.