In 2021, it seemed like nothing could stop the upward trajectory of big technology stocks like Amazon (AMZN -0.07%). The economy was booming as COVID-19 vaccines allowed pandemic-driven social distancing measures to be relaxed, and the digital advertising market hit new heights, leaving investors optimistic about internet stocks.

But then, 2022 happened. High inflation, rising interest rates, and geopolitical turmoil have turned investors from extreme optimists to pessimists -- particularly when it comes to technology stocks like Amazon, which has steadily fallen 48% year to date. 

But you shouldn't let the market's short-term pessimism keep you from investing for the long term. Here's why beaten-down Amazon is the best big tech stock to buy for 2023 and beyond. 

Amazon's e-commerce business should thrive

There's a narrative out there that e-commerce hit its peak during the COVID-19 pandemic, and that as more people return to in-person shopping, online shopping will shrink. But for Amazon, that couldn't be further from the truth. Last quarter, revenue from its online stores segment grew by 13% year over year (excluding foreign currency exchange impacts) to $53.5 billion. More importantly, its third-party seller revenue grew 23% to $28.7 billion, which shows that more and more merchants are selling through its marketplace.

While investors don't have the privilege of knowing the profit margins of these e-commerce business units, it is safe to assume they are quite low. E-commerce is a tough business, and like retail giants Wal-Mart and Costco, Amazon's core business likely has low margins. But unlike other retailers, Amazon has a few tricks up its sleeve to drive its margins higher over the long term. These include subscription services like Amazon Prime (which booked $8.9 billion in revenue last quarter) and advertising ($9.5 billion in revenue last quarter). The advertising segment's revenue grew by 30% year over year in Q3 and will be vital for driving consolidated margin growth over the next few years.

Add all this together, and I think investors are underrating the holistic value Amazon can create for shareholders through its e-commerce ecosystem, especially if advertising revenue continues growing at an impressive double-digit percentage rate.

The real value for Amazon is in the cloud

Even though I think investors are too pessimistic about Amazon's e-commerce ecosystem, the true value of its business over the next decade will come from Amazon Web Services (AWS), its cloud computing division. AWS is the leading cloud infrastructure provider worldwide, with an estimated 32% market share in this huge and fast-growing industry.

Last quarter, AWS hit $76.5 billion in trailing 12-month revenue, up 34% year over year. The segment has put up impressive growth over the past few years. In Q3 2018, for reference, AWS had just $23 billion in trailing 12-month revenue. The segment now has sales close to that each quarter. And the growth is just getting started. Analysts project the cloud computing market will grow at an annualized rate of 15.7% from now until 2030, hitting $1.55 trillion by then. Five years from now, if AWS grows by 15% a year in line with the overall industry, it will hit a whopping $154 billion in annual revenue.

The best part about AWS? It has much higher profit margins than e-commerce, posting 30% operating margins over the past 12 months. To be conservative, let's estimate that AWS's margins will decline to 25% over the next five years as the industry matures. At $154 billion in revenue, that equates to $38.5 billion in annual profits just from AWS. And remember, this is factoring in potential margin deterioration and decelerating revenue growth, which are not guaranteed to happen. It wouldn't be surprising to see AWS keep putting up 20%-plus revenue growth over the next five years as it has for the last five, but it is wise to be conservative when making financial projections. 

Right now, Amazon's market cap is nearly $900 billion. Applying $38.5 billion in AWS earnings, the stock could be trading at a price-to-earnings ratio of 23.5 five years from now just based on AWS and valuing the entire e-commerce operation at zero. Clearly, Amazon's vast e-commerce empire is worth more than zero. If you believe the steady growth of AWS and advertising at Amazon will persist, the stock looks like an easy buy at these levels if you plan to hold on for five or more years.