For years, investors could count on Amazon (AMZN -0.61%) to boost their portfolios. The e-commerce and cloud computing giant climbed more than 300% over the past five years. But these days, many investors aren't as thrilled with their investment in the company. The economic situation has hurt earnings. And the stock is heading for a 40% loss this year.

So, today, as an Amazon shareholder, you may be wondering what to do. Economic pressures like higher inflation won't disappear overnight. And that means the road ahead for Amazon probably will be bumpy for a while. Before you decide whether to sell your Amazon shares, stick with holdings, or make an even bigger bet on the company, hang on. First, let's consider the worst mistake Amazon investors can make right now.

More than 70% of operating income

It's important to remember Amazon has long relied on Amazon Web Services (AWS) for profit. The cloud computing business last year accounted for more than 70% of Amazon's total operating income. Customers may think of Amazon as an e-commerce business. And it is. But AWS should be the focus when it comes to examining Amazon's profitability picture.

This brings me back to the worst mistake Amazon investors can make today. And that's ignoring the following two points. First, AWS's net sales have grown in the double digits since at least 2018.

Year AWS net sales increase
2018 47%
2019 37%
2020 30%
2021 37%

Data source: Amazon.

The growth rate has slowed, then accelerated. But over time, AWS has continued to increase sales. What this means is investors shouldn't be overly worried if AWS sees a decline in growth rates here and there. This doesn't indicate a long-term drop in demand for AWS's offerings.

In the most recent quarter, AWS sales growth slowed to 27%. For a specific, and likely temporary, reason. AWS customers are feeling the pressure of higher inflation -- and that means they're reining in spending right now. But things should pick up when this pressure declines.

Here's the second point to consider. The global cloud computing market, at a compound annual growth rate of 15%, is forecast to reach $1.5 trillion by 2030, according to Grand View Research. And AWS is the market leader.

An increasing investment

Even though times are tough right now, Amazon continues to invest in and expand its cloud computing infrastructure. In fact, in the most recent earnings call, Amazon said it's increased its investment in AWS by $10 billion this year compared to last year.

All of this means Amazon is well positioned to benefit from this growing cloud computing market over time.

Of course, investors may have to put up with more quarters of disappointing earnings and slower AWS growth. This can be frustrating.

But it's important to remind yourself of one thing. The best way to win on your investments is to hold on for the long term. By this, I mean at least five years. This gives a company enough time to grow -- or recover if it's struggled. And it gives the share price enough time to reflect the good news.

So, to recap: The worst mistake Amazon investors could make right now is ignoring the importance of AWS's growth over time -- and future potential considering market size and Amazon's market leadership. If investors do ignore these points, they may be tempted to sell Amazon shares, and miss out on a great long-term story.