High-flying stocks like Amazon (NASDAQ: AMZN) justifiably capture the attention of investors, but it can be difficult to reconcile Amazon's great performance with the prevailing wisdom of diversification and indexing. Deciding between Amazon and the whole S&P 500 index (SNPINDEX: ^GSPC) should be an easy choice for the vast majority of investors, but the better buy ultimately depends on several factors specific to the individual, such as risk tolerance and other portfolio holdings. The S&P will never match Amazon's upside potential Amazon has achieved a 25.8% revenue compound annual growth rate (CAGR) over the past five years along with a 115% earnings-per-share (EPS) CAGR. This outstanding fundamental performance has translated to excellent returns in the stock market. Amazon shares have risen 384% over those five years, five times more than the S&P return over that period. The company is a leader in e-commerce, and data storage and management, which are both high-growth categories for the medium term. Competition is always a threat to stability, but there's no reason to expect Amazon's strong results to halt, given its position and industry exposure. Image source: YCharts, November 2020 Upside potential for the entire S&P 500 is limited by the very nature of diversification. The average annual revenue growth rate for the S&P 500 is around 4%, and investors should not expect that to outpace GDP growth by a significant margin over the long term. Large companies in growth industries might take market share away from smaller competitors, and earnings growth can outpace sales growth as efficiency is gained with scale, but there are only so many dollars to go around. Average annual returns for the S&P 500 as a whole have been in the high single digits, and investors should not expect any long-term divergence from that. Sound investment strategies balance risk and return Diversification is an established portfolio construction principle, and for good reason. Owning a variety of stocks dilutes business risk in a portfolio, meaning that the failures or struggles of any single company cannot drastically jeopardize the portfolio's overall investment performance. Image source: Getty Images Successful stock market investing requires some educated guessing and leaps of faith, because the future obviously can't be known for certain. This is especially true when we project into the long term, when more unexpected events can influence outcomes. However, we can assume with certainty that a single company is more likely than the entire economy to endure catastrophic failure that leads to equity depreciation. Former market leaders such as Blockbuster, Enron, Woolworth, Compaq, Pan Am, Kodak, and Blackberry can attest to this. There is a long list of famous businesses that have fallen from grace as the world changed. It's unwise for investors, who have no control over a company's operations, to make massive bets that a company will continue to flourish multiple decades down the line. Amazon is only a better buy than the whole S&P 500 for investors who already have a diversified portfolio and are looking for a somewhat speculative high-growth position. Everyone else should consider the ETFs or mutual funds that track the S&P 500. The Vanguard S&P 500 ETF (NYSEMKT: VOO) and SPDR S&P 500 ETF Trust (NYSEMKT: SPY) are reputable, liquid investment vehicles with low expense ratios that can be purchased on the open market. Investors can expect these to provide long-term growth without extreme volatility. Amazon even represents close to 5% of their portfolios, so holders will enjoy some upside from the tech giant. Investors, though, should cover their financial bases before assuming major long-term risks. Find out why Amazon is one of the 10 best stocks to buy now Motley Fool co-founders Tom and David Gardner have spent more than a decade beating the market. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.* Tom and David just revealed their ten top stock picks for investors to buy right now. Amazon is on the list -- but there are nine others you may be overlooking. Click here to get access to the full list! *Stock Advisor returns as of October 20, 2020 John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Ryan Downie has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Amazon. The Motley Fool owns shares of Vanguard S&P 500 ETF. The Motley Fool recommends BlackBerry and recommends the following options: short January 2022 $1940 calls on Amazon and long January 2022 $1920 calls on Amazon. The Motley Fool has a disclosure policy.Source