Buying and holding solid companies for the long run is a tried and tested way of making money in the stock market, and that's not surprising as it allows investors to benefit from the power of compounding and also enables them to capitalize on secular growth trends in various industries.

For instance, an investment of $1,000 made in an index fund replicating the performance of the tech-heavy Nasdaq Composite index 10 years ago is now worth more than $4,200. In this article, we will take a closer look at two breakout stocks that have rallied impressively in the past six months and are operating in lucrative markets that seem set for robust growth over the next decade.

Twilio: Well-placed to gain from the cloud communications market's growth

The communications platform-as-a-service (CPaaS) market was worth an estimated $12.3 billion last year, but it is expected to hit $121 billion in annual revenue by 2034 by clocking a CAGR of 25%. Twilio (TWLO -2.76%) is one of the key players in this market. Investors have been buying its shares hand over fist lately, as evidenced by the 97% jump in the company's stock price in the past six months.

That's not surprising as Twilio's growth has started accelerating thanks to the growing adoption of artificial intelligence (AI) within the cloud communications market. The company generated $3.26 billion in revenue in the first nine months of 2024, and its Q4 guidance of $1.15 billion suggests that it is on track to finish the year with $4.41 billion in revenue.

That means Twilio's share of the CPaaS market stands at almost 36% based on the $12.3 billion revenue that this market generated in 2024. If Twilio manages to hold onto even a 30% share of the CPaaS market in 2034, its top line could hit $36 billion. Assuming Twilio trades at 3 times sales after a decade, in line with the S&P 500 index's average sales multiple, and manages to achieve $36 billion in revenue at that time, its market cap could jump to $108 billion.

That would be a jump of just over sixfold from current levels. So, Twilio has the potential to become a multibagger over the next decade, and the good part is that the company is taking steps to ensure that it remains a key player in the CPaaS market. On its October 2024 earnings conference call, Twilio management pointed out that it has been focused "on embedding AI and machine learning throughout the Twilio platform."

This strategy has allowed the company to differentiate its communications platform, which probably explains why customers are spending more money on its offerings. This is evident from the fact that Twilio's revenue in Q3 2024 increased 10% year over year, faster than the 7% growth it recorded in the first two quarters.

Looking ahead, analysts have increased their growth expectations from Twilio.

TWLO EPS Estimates for Current Fiscal Year Chart

TWLO EPS Estimates for Current Fiscal Year data by YCharts

The prospects of the industry which Twilio serves, as well as the company's solid share of this space, suggest it can maintain healthy levels of growth for a long time following the next couple of years. That's why investors can consider buying this growth stock right away, as its forward earnings multiple of 27 suggests that it isn't all that expensive when compared to the Nasdaq-100's forward earnings multiple of 27.

Fortinet: The cybersecurity market's growth will be a tailwind for this company

The global cybersecurity market was worth an estimated $215 billion in 2024, according to market research provider Roots Analysis. This market is expected to clock 11.3% annual growth over the next decade, generating annual revenue of $697 billion in 2035. Fortinet (FTNT -1.54%) gives investors an avenue to make the most of this massive end-market opportunity.

Shares of the cybersecurity specialist have shot up an impressive 59% in the past six months, driven by a couple of solid quarterly reports. The good part is that the stock can still be bought at a reasonable 39 times forward earnings even after its recent surge, which isn't all that expensive when we consider that the tech-laden Nasdaq-100 index has a price-to-earnings ratio of 33.

Buying Fortinet at this valuation could turn out to be a smart long-term move, considering the healthy growth in its revenue and earnings, as well as the huge addressable opportunity in the cybersecurity market. For instance, Fortinet's revenue in the third quarter of 2024 increased 13% year over year to $1.5 billion. What's more, its non-GAAP (adjusted) operating margin jumped 8.3 percentage points from the year-ago period to a record 36% in the quarter.

As a result, Fortinet's adjusted earnings shot up 54% to $0.63 per share. The company expects to report $5.9 billion in revenue for 2024, along with $2.24 per share in earnings at the midpoint of its guidance range. Those numbers would translate into an 11% jump in its top line, along with a 37% increase in its earnings for the year.

More importantly, the growing adoption of Fortinet's solutions targeting fast-growing cybersecurity niches such as security operations (SecOps) and secure access service edge (SASE) is helping it build a solid revenue base for the long run. That's evident from the 15% year-over-year growth in Fortinet's remaining performance obligations (RPO) last quarter to $6.1 billion.

RPO is the total value of a company's contracts that are unfulfilled at the end of a quarter. So, the faster increment in this metric, when compared to Fortinet's top line, points toward a potential improvement in the company's growth when it fulfills those contracts. Additionally, Fortinet management pointed out that its potential sales pipeline improved by 30% in the third quarter.

There is a good chance that Fortinet will continue to witness strong growth in its revenue pipeline over the next decade as well, thanks to its solid position in markets such as network firewalls, where it claims to be the leading vendor with a market share of just over 50%. These opportunities explain why Fortinet expects its revenue to increase at a CAGR of 12% over the next three to five years while maintaining an operating margin of more than 30%.

So, investors looking to make the most of the cybersecurity market's growth can consider buying Fortinet following its recent breakout, as it has the potential to remain a solid growth stock over the next decade.