It's becoming more evident that Amazon (AMZN -3.19%) is a tale of two businesses: e-commerce and cloud computing. And their performance couldn't be more different either. Amazon Web Services (AWS) is crushing it, while e-commerce is struggling to turn a profit.

Is a company that is having mixed results worth owning? Let's find out.

Strong revenue, weak earnings

The sales-growth headline number for Amazon's third quarter was impressive: 15% year-over-year (YOY) revenue growth to $127.1 billion. However, the real issue was Amazon's net income, which fell to $2.9 billion from $3.2 billion last year.

But as alluded to above, the headline numbers don't tell the whole story.

Only when Amazon's three primary segments are dissected can investors get the complete picture.

Segment YOY Revenue Growth Operating Margin
North American Sales 20% (0.5%)
International Sales (5%) (8.9%)
AWS 27% 26.3%

Source: Amazon.

While the commerce side of the business struggled on the profitability front, it's reassuring that North American sales are growing at such a healthy pace after only growing at 10% and 8% in the second quarter and first quarter, respectively.

Amazon is also well prepared for the holiday season with strong inventory levels. However, CFO Brian Olsavsky said in Amazon's conference call: "[W]e're realistic that there's various factors weighing on people's wallets, and we're not quite sure how strong holiday spending will be versus last year."Amazon is cautiously optimistic about Q4, which is probably the correct mindset with the general economic uncertainty.

Its advertising services are buried within Amazon's commerce segments, which should have struggled in Q3 if you just looked at other advertising businesses like Alphabet or Meta Platforms. Instead, it grew 25% YOY to $9.5 billion. Additionally, third-party seller services had its best quarter over the past year, with revenue rising 18% YOY to $28.7 billion.

While we don't know if these segments are profitable, their growth and revenue share are significant compared to Amazon's online store, which posted 7% YOY growth to $53.5 billion.

Amazon is a master at developing new segments, and these two are ones to keep an eye on.

AWS excels again

Without AWS, Amazon would be unprofitable. It has also been a large part of Amazon's growth recently, with Q3's 27% growth the lowest it has experienced in many years. One reason for the slower growth is cost optimization, as customers look to streamline their spending to save money where possible.

However, AWS isn't slowing its expansion, as Amazon's capital expenditures have been about the same in 2022 as in 2021 but with $10 billion more spent on its AWS infrastructure. Investors will need to keep an eye on AWS in future quarters to ensure the growth stays in the mid-20% range, but the segment is performing well, and investors shouldn't nitpick it too much.

While both segments had pretty good Q3s, the stock dropped about 7% after the report, primarily due to Amazon's guidance.

In Q4, Amazon's sales are expected to rise between 2% and 8%, with operating income between $0 and $4 billion. That's a pretty wide range, and it will obviously be affected by how strong the consumer is during the holiday period.

Still, the stock is attractively priced. With $502.2 billion in sales over the past 12 months and a market cap of $1.05 trillion, Amazon's stock trades at 2.09 times sales. To find a time when Amazon was this cheap, you have to backtrack all the way to 2015.

There's a lot of fear baked into Amazon's stock with how the economy is doing, which is a fair argument. However, long-term investors should know that a recession won't last forever. Once the economy recovers, Amazon will likely experience pent-up demand, affecting both its commerce and cloud-computing segments.

Investors may experience some more stock-price drops in the short run. However, Amazon's long-term prospects still look bright with a booming AWS business, strong advertisement growth, and a third-party seller service that is starting to challenge Amazon's own commerce store.

I'm a buyer of Amazon's stock, but I'm willing to hold the stock for five years to see market-beating returns.