An ugly market selloff couldn't stop (AMZN) - Get Report from rallying following a strong Q4 report.

The e-commerce/cloud giant reported Q4 revenue of $60.45 billion (up 38% annually) and GAAP EPS of $3.75, beating consensus estimates of $59.74 billion and $1.84. It also guided for Q1 revenue of $47.75 billion to $50.75 billion (up 34% to 42%), above a $48.6 billion consensus at the midpoint.

Shares rose 2.9% on Friday to $1,429.95, in spite of a 2% Nasdaq drop. Here are some key takeaways from Amazon's report.

    E-commerce growth slowed a bit, but remained pretty strong

    Officially, Amazon's North American e-commerce reporting segment saw revenue rise 42% to $37.3 billion. But after backing out the impact of the Whole Foods acquisition -- most of the $4.5 billion in "physical stores" revenue Jeff Bezos's company reported came from North American Whole Foods stores -- growth was around 25%. That's down a bit from Q3's 28% non-Whole Foods growth, but still easily better than the estimated 15% growth the U.S. e-commerce market is seeing.

    Amazon's international segment, benefiting from strong European and Indian growth, saw revenue rise 29% to $18 billion. But excluding forex swings, growth was 22%, which is down from the 28% forex-neutral growth seen in Q3. On the earnings call, CFO Brian Olsavsky noted Prime Day provided a big Q3 international sales lift that naturally wasn't replicated in Q4, while adding India continued to perform very well.

    Though the law of large numbers affected Amazon's e-commerce ops some in Q4, it's hard to complain too much, particularly given the solid Q1 guidance. The drivers that have let Amazon take e-commerce share one quarter after the next -- Prime adoption, big warehouse investments, a top-notch user experience and a steadily-expanding seller base -- remain in place. And the company still has quite a lot of international headroom, particularly when one considers how low its penetration rates remain in some big European, Latin American and (even if one ignores China, where Alibaba (BABA) - Get Report  and (JD) - Get Report remain dominant) Asian markets.

      Spending growth also slowed a little, providing a lift to earnings

      In Q3, Amazon's total costs and expenses grew 35%, outpacing revenue growth of 34%. With a full quarter of Whole Foods providing a boost, costs and expenses grew 37% in Q4 to $58.33 billion. But that trailed revenue growth of 38%.

      Amazon is still spending at a pretty aggressive pace. Fulfillment spend rose 57% to $9 billion; marketing spend rose 37% to $3.4 billion; and tech/content spend (boosted by both R&D and Prime Video investments) rose 39% to $6.3 billion. Capex also continues to grow rapidly: Purchases of property and equipment (driven by warehouse investments) rose 50% to $3.6 billion, and spending on property and equipment via capital leases (driven by AWS) rose 36% to $2.8 billion.

      But Amazon's scale and margin profile have reached a point where even a modest drop in spending growth can have a big impact on its bottom line. That said, Q1 is shaping up to be another aggressive spending quarter: In spite of its strong sales guidance, Amazon only expects Q1 operating income of $300 million to $1 billion, which compares with a year-ago level of $1 billion.

        Momentum remains strong for AWS and other higher-margin businesses

        Also boosting EPS in Q4: Amazon's continued revenue mix shift towards higher-margin services. Gross margin (GM) rose to 36.3% from a year-ago level of 33.8%. And for Q1, a seasonally stronger quarter for margins, the analyst consensus is for a GM of 38.1%.

        Amazon Web Services (AWS), which (in spite of Microsoft (MSFT) - Get Report  and Alphabet/Google's (GOOGL) - Get Report strong cloud growth) continues towering over the public cloud services market, definitely has a lot to do with this trend. AWS revenue grew 45% in Q4 (topping Q3's 42% growth) to $5.11 billion, beating a $4.97 billion revenue consensus. And in spite of heavy capex, the segment's operating income grew 44% to $3.76 billion.

        Also boosting margins:

          Revenue from third-party seller services (commissions, fulfillment services, merchant loans, etc.) grew 41% to $10.5 billion. That was well above the 20% growth recorded for Amazon's online store (direct e-commerce) sales, which carry lower margins on average and totaled $35.4 billion.

          Subscription services revenue, which is driven by Prime membership fees, grew 49% to $3.2 billion. It worth noting, though, that this was slower than Q3's 59% growth. Amazon's recent Prime monthly fee hike could provide a boost going forward.

          "Other" revenue, which is driven by e-commerce ad sales, rose 62% to $1.7 billion. The popularity of Amazon's site and app, together with Amazon's ability to use its shopping data to deliver targeted ads on both its properties and elsewhere, fueled the ad growth.

          For now, Amazon is intent on funnelling almost every extra gross margin dollar it gets back into its business. But if and when this changes, the company's margin growth (when combined with its revenue growth) could allow its earnings and free cash flow to soar in a hurry.

          And markets seem well-aware of that these days.

          Jim Cramer and the AAP team hold positions in Microsoft and Alphabet for their Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells MSFT or GOOGL? Learn more now.

          More of What's Trending on TheStreet: