Amazon.com (AMZN -2.85%) stock fell after the company reported its second-quarter earnings results on July 29. Investors were disappointed by slowing revenue growth and management's outlook, which includes an even bigger slowdown in the third quarter.

But if you look at what's really happening at Amazon, there are a lot of reasons to be optimistic about the long-term revenue and profit growth of the company. That's why I snatched up a few more shares of the FAANG stock after the sell-off.

Person in a warehouse packing up a box with Amazon's logo.

Image source: Amazon.com.

A look under the hood of Amazon's second-quarter revenue

Amazon breaks down its revenue into six segments as part of its supplemental reporting each quarter. Here's the revenue growth for each segment over the last five quarters adjusted for changes in foreign exchange.

Segment

Q2 2020

Q3 2020

Q4 2020

Q1 2021

Q2 2021

Online stores

49%

37%

43%

41%

13%

Physical stores

(13%)

(10%)

(7%)

(16%)

10%

Third-party seller services

53%

53%

54%

60%

34%

Subscription services

30%

32%

34%

34%

28%

Amazon Web Services

29%

29%

28%

32%

37%

Other

41%

49%

64%

73%

83%

Data source: Amazon second-quarter earnings report. Table by author.

There's a clear standout from the table above. In the top right corner, you can see online stores' sales growth slowed to just 13%. That underperformance is the sole reason Amazon missed analysts' expectations for revenue growth last quarter.

Meanwhile, Amazon's most profitable segments -- AWS and other, which is composed primarily of advertising -- actually saw revenue growth accelerate. Third-party seller services held up well, growing 34%, which is actually faster than its pre-pandemic growth rate. And subscription services growth remained steady throughout the last year.

All this means that despite slower revenue growth in the near term, the most profitable segments are contributing a significant portion of that growth. As a result, Amazon ought to see some strong results on the bottom line even if the top line result doesn't meet expectations.

Amazon is in the midst of an investment cycle

True to form, Amazon won't let the bottom line inflate too much. It started accelerating its fulfillment capacity buildout in 2019 with the introduction of one-day Prime shipping, and the pandemic only added fuel to that effort.

"This is all part of a multiyear investment cycle for us," CFO Brian Olsavsky said during the company's second-quarter earnings call. "Unit volumes, while obviously growing at lower rates off last year's large comp, continue to remain high, and we see strong demand for FBA and third-party sellers."

It also takes some time for Amazon to ramp up the capacity of newly opened fulfillment centers, so after nearly doubling its footprint in the last 18 months, it has some catching up to do. Olsavsky says one-day delivery is still below the rate it saw pre-pandemic.

As Amazon ramps up its capacity, online store sales and third-party services, which both saw marked decelerations in the second quarter, ought to return to faster growth.

Furthermore, if Amazon ever takes its foot off the pedal and maximizes its full capacity, last year's results show how profitable it can really be when leveraging the fulfillment network. It posted record operating profit margins last year despite spending billions on COVID-19-related expenses. That's why management's outlook for operating margin contraction in the third quarter doesn't worry me.

On top of that, as the fulfillment network expands (including the airhub opening this year), Amazon can leverage its network to deliver more items itself instead of relying on third parties. Ultimately, Amazon Logistics could become another profitable business unit for the company.

A good opportunity

Amazon's share price is still down 7% since its second-quarter results came out. I took the opportunity to buy shares, because the long-term trends behind e-commerce, cloud computing, and digital advertising are all still very much intact, and Amazon is a leader in all three categories. 

Digging further into the earnings results shows the weakness is limited to Amazon's first-party retail business. That's acceptable to me when coming up against last year's events and the effect they had on Amazon's business. What's more, the company is investing in its future with the expectation that demand for its retail business will continue to increase significantly over the next few years. Management has a lot more insight into its customers than I do, so they're probably onto something.