The tech-heavy Nasdaq Composite index just recorded its best first half of a year since 1983, driven predominantly by high-growth tech companies like Apple, Microsoft, and Alphabet.

But investors should be wary about that kind of performance continuing. With all the recent hype around artificial intelligence and the increasing return investors can now get through low-risk Treasuries, it's not unreasonable to think there could be some sort of a reversion in the prices of many high-growth tech stocks. 

Even in a market pullback, though, there is one stock that investors shouldn't stop buying: Amazon (AMZN 2.33%).

An all-weather business

Amazon, the world's largest online retailer, prides itself on being customer-focused. For shoppers, that can mean low prices and unmatched delivery times. And in an uncertain economy, that's the kind of stuff shoppers really start to prioritize. 

This was evident in last year's financial results. Despite the pressure U.S. consumers felt from high inflation in 2022, Amazon grew its North American retail sales by 13% versus 2021. And that year's boost in sales came after the year with the largest revenue growth that Amazon has ever experienced due to the surge in online spending during the pandemic.

But it's not just Amazon's retail operations that are proving resilient during tough times. Its ad revenue has shown remarkable growth despite a massive slowdown in overall digital advertising. According to industry analysts, digital ad revenue in the U.S. declined by 4.4% during the fourth quarter of 2022. Meanwhile, Amazon's high-margin advertising unit was growing by 23% during the same period. 

Then there's Amazon Web Services (AWS), its cloud computing arm and primary profit driver. AWS did see a slight deceleration in revenue growth due to enterprises cutting back on infrastructure spending, but for most companies, it is still a more attractive solution than handling those workloads on-premises. On the fourth-quarter conference call, Chief Financial Officer Brian Olsavsky summed it up: "The quickest way to save money is to get to the cloud, quite frankly. So there's a lot of long-term positives in tough economic times."

When times get tough, Amazon gets tougher

One benefit of being a scaled-up player when things go awry is that you have the capacity to invest more than others. Throughout all the turbulence the economy has experienced over the last two years, Amazon has made more than $120 billion in capital expenditures to further build out its fulfillment network and cloud computing infrastructure. While this has certainly hurt profitability in the short term due to excess capacity, it's now proving to be a major logistics advantage versus other companies. 

For example, two months ago, e-commerce competitor Shopify (NYSE: SHOP) announced that it was selling its Shopify Logistics business to Flexport while also laying off 20% of its staff. And other merchant-hosting platforms such as BigCommerce (NASDAQ: BIGC) and Wix.com (NASDAQ: WIX) have chosen to use Amazon's fulfillment network by integrating its Buy With Prime feature into their checkout process instead of trying to build out their own logistics channels. 

Valuation

Although Amazon's culture of reinvestment can make it tough to value on a current earnings basis, it doesn't take very aggressive estimates to see how the company can generate good returns for shareholders. Over the last 12 months, it generated $525 billion in revenue, and its average operating margin over the last five years has been roughly 5%.

So if you apply that same level of profitability to the company's current sales, Amazon's stock would be trading at a market-cap-to-operating-income ratio of about 50. That's pretty expensive.

However, the company's current revenue makeup isn't quite the same as it used to be. Today, high-margin business units like AWS, advertising, and third-party seller services account for a much larger share of the company's overall sales. So it wouldn't be too far-fetched to imagine that Amazon could be generating more than 10% operating margins if it really cut back on its investments. That would imply a market-cap-to-operating-income ratio closer to 25, assuming sales don't grow.

For a business with durable competitive advantages and an unparalleled track record of growth, that strikes me as a very reasonable price to pay.