The Nasdaq Composite is one of the three major stock market indexes, tracking almost all stocks trading on the Nasdaq exchange. Over the past decade, the Nasdaq Composite has been the best-performing of all major indexes, up more than 275%, compared to 167% and 127% for the S&P 500 and the Dow, respectively.

While there are thousands of companies included in the Nasdaq Composite, here are three that I'm buying consistently for the long haul.

1. PepsiCo

When many people think of the Nasdaq, they automatically think of technology companies. Major companies from all sectors are represented, though, including food and beverage giant PepsiCo (PEP -0.62%). Its stock has been lackluster this year, down just under 2% year to date as of Aug. 22, but that's along the lines of most companies in its industry.

Coca-Cola is the world's most popular beverage company, but it falls short compared to how much revenue PepsiCo pulls in. In its second quarter (ended June 17), PepsiCo had $22.3 billion in revenue, up 10.4% year over year and more than $10 billion higher than Coca-Cola's second-quarter revenue.

PEP Revenue (Quarterly) Chart

Data by YCharts.

This huge gap exists because PepsiCo's business is very diversified between food and beverages. Beverages accounted for just under 51% of its North America second-quarter revenue. The rest came from its food subsidiaries, Frito-Lay North America and Quaker Foods North America.

PepsiCo's diverse portfolio gives it stability and longevity because it's not as reliant on the performance of a single market. The company has also increased its dividend annually for 50 consecutive years. It's all but guaranteed to provide consistent income for investors regardless of its stock's performance.

2. Amazon

Amazon's (AMZN 3.43%) stock has accurately demonstrated what it's like to be a growth stock investor over the past few years. There are many swings in both directions that reaffirm the fact that growth stocks aren't for the impatient or shortsighted.

After seeing its value almost cut in half in 2022, Amazon is up over 57% in 2023.

Amazon became a household name through its e-commerce business, but many people would be surprised at how unprofitable it has been. It was essentially a way for Amazon to build its customer base and cash flow while investing in and developing more-profitable segments like Amazon Web Services (AWS).

However, the narrative around Amazon's e-commerce business is changing as the company has found ways to bring it to profitability. In the second quarter, Amazon's North American retail segment had $3.2 billion in operating income, up from $898 million in the first quarter and a noticeable turnaround from the $627 million it lost in the second quarter of 2022.

Aside from the specific financials, what has me excited about Amazon is how the company has managed to do it: with cost-cutting and better logistical efficiency. The company moved away from its national fulfillment network model to an eight-network regional model that has reduced many delivery inefficiencies.

Amazon is more focused on growth than profitability, but as the company's operations become more efficient, the eventual transition should lead to sustained profits for the long haul.

3. Microsoft

While I'm hesitant to call it recession-proof, I have no problem calling Microsoft (MSFT 1.82%) the most recession-resistant big-tech stock there is. Through decades of developing (or acquiring) essential software, products, and services, the company managed to intertwine itself with the business world in a way that all but guarantees its growth and longevity.

Microsoft's diverse revenue streams help reduce its risk of market fluctuations. In its fiscal 2023 (ended June 30), it had $211.9 billion in revenue, up 7% year over year. Here's how that was broken down by its three broad segments:

  • Productivity and business processes: $69.27 billion
  • Intelligent cloud: $87.90 billion
  • More personal computing: $54.73 billion

Within those segments was even more diversification: its Office software, PCs, Xbox, LinkedIn, the Azure cloud platform, search advertisement, and plenty of others -- all of which carry their fair share of weight.

Many of its clients are corporations, which tend to be more reliable income sources over time. When the economy is struggling, and consumers cut back on discretionary spending, Microsoft's corporate clients are more likely to continue their subscriptions and provide consistent cash flow. It's much easier for a consumer not to upgrade to the latest electronics than for a corporation to drastically reduce its cloud subscription.

The dividend yield is below 1%, but it's an added bonus nonetheless. In the past 10 years, Microsoft is up over 920%, but it jumps to over 1,100% when you include its dividend -- a nice luxury for long-term investors.