Artificial intelligence (AI) infrastructure stocks are still one of the biggest driving forces in the market. While Nvidia (NVDA +1.80%) helped lead the early charge, other stocks, like Micron (MU +0.22%), have greatly outperformed the AI leader over the past year.
Let's dive into both AI stocks to see which one looks set to outperform over the next five years.
Nvidia
Nvidia was the first big AI winner, and the advantages the company established remain in place today. Meanwhile, despite its massive size, the company continues to put up incredible growth. In Q2 2027, it more than doubled its revenue to a whopping $96.2 billion, with 117% growth in its data center segment. Meanwhile, it projected growth of 89% next quarter and 70% for fiscal 2028 (ending January 2028), while saying it remains capacity-constrained. In other words, it would be growing even faster if it could make more chips.

NASDAQ: NVDA
Key Data Points
At the heart of Nvidia's growth story remains its graphics processing units (GPUs) and its CUDA software platform. Most early AI code was written using CUDA and optimized for its GPUs, which has given the company a wide moat in AI model training. That moat remains intact today, but the company is much more than just GPUs.
Today, Nvidia is a complete AI infrastructure company, offering full server racks designed for specific AI tasks, such as training, inference, and agentic AI. The company took a big leap in the inference market following its "acquisition" of Groq and its language processing units (LPUs). These chips, with a small amount of SRAM (static random-access memory) built in, can access memory quickly and reduce latency, making them great for the decode phase of inference, while its GPUs handle the more compute-heavy pre-fill phase. Meanwhile, it has also developed its own Arm-based central processing units (CPUs) specifically aimed at agentic AI. It then ties it all together with its powerful networking portfolio.
With Nvidia firmly established as the AI model training leader and well positioned for the fast-growing inference and agentic AI markets, this is a company that has a lot of growth in front of it over the next five years. Meanwhile, the stock is still attractively valued, trading at a forward price-to-earnings (P/E) ratio of 14 times analyst estimates for fiscal 2028 (ending January 2028).
Image source: The Motley Fool.
Micron
Micron has been riding the memory supercycle to astounding growth. The company saw its revenue last quarter surge to $41.5 billion from $9.3 billion a year ago, while its gross margin expanded to 84.6% from 37.7%. That led its adjusted earnings per share (EPS) to skyrocket from just $1.91 a year earlier to $25.11.

NASDAQ: MU
Key Data Points
The revenue growth and margin expansion are coming from a huge supply-demand imbalance within the memory market. The company is one of the big three DRAM makers -- along with Korean companies SK Hynix and Samsung -- and derives around three-quarters of its revenue from DRAM and a quarter from NAND (flash). AI is driving memory demand, as GPUs are packaged with high bandwidth memory (HBM), a special form of DRAM that helps reduce latency and optimize performance, and AI training data is being stored in enormous solid state drives (SSDs) that use flash memory.
Rival SK Hynix has predicted that the DRAM market will remain supply-constrained through at least 2030, while Micron and its rivals have begun to lock in long-term contracts for up to five years for the first time ever. This should help reduce some of the extreme cyclicality the industry has seen in the past.
On a forward P/E basis, Micron looks very cheap, trading at only 6 times analyst estimates for fiscal 2027 (ending August 2027). The question is how long the memory cycle will last and whether there has been enough of a structural shift in the market to keep prices high.
The verdict
I think the easy answer here is that Nvidia will outperform Micron over the next five years. Micron is still a cyclical stock until proven otherwise, and five years is a long time for a cycle to last. Meanwhile, Nvidia has built one of the most complete and powerful AI infrastructure companies on the planet, and the stock is very attractively valued given its growth and moat.





