Wall Street could hardly be more excited about tech stocks right now, especially those with exposure to popular growth spaces like artificial intelligence (AI) and enterprise services. These investments rallied in 2023 into 2024 on falling fears about a recession developing this year. Companies in these niches are reporting faster sales gains and improving earnings power, two key factors supporting market-beating shareholder returns.

Amazon (AMZN 3.43%) and Shopify (SHOP 1.11%) are two excellent examples. The companies have different approaches but have each identified e-commerce and merchant services as huge long-term growth avenues. Against that backdrop, let's look at which impressive stock would make the better long-term buy for investors today.

Sales trends

Amazon is a huge business, and as so its growth rate is limited by that massive size. Sales rose 14% in the fourth quarter, improving to $170 billion from $149 billion a year ago. Compare that to Shopify's blazing 24% revenue increase in the same period (with sales landing at $2.1 billion). Put another way, Amazon gained 3 times more revenue year-over-year last quarter than Shopify generated in the past full year.

Yet Shopify's smaller footprint is an advantage when it comes to sales growth opportunities. Most Wall Street pros are expecting Shopify to keep expanding at a 20%-plus rate in 2024, or about double Amazon's projected pace. In relative terms, it's clear which one is the faster-growing stock.

Look closer, though, and you'll see a key difference between Amazon's two main sales categories. Its e-commerce segment expanded at a less-than-10% rate while the services division, which now accounts for 55% of sales, rose at a 15% rate last quarter. While its e-commerce unit is constrained by its size, Amazon still has a huge growth target around the enterprise web services industry.

Profit trends

Amazon is the clear winner in this matchup with respect to its finances. Start with the fact that the company is extremely profitable, having generated $37 billion of operating income over the past year compared to Shopify's $1.4 billion of losses. Yet Amazon's cash flow trends are even more impressive and point to potentially significant profitability increases in 2024 and beyond.

AMZN Cash from Operations (TTM) Chart

AMZN Cash from Operations (TTM) data by YCharts

An 80%-plus increase in operating cash flow in 2023 resulted from a new focus on efficiency that could push Amazon's profit margin toward the double digits. Shopify briefly achieved a 12% profitability rate, for context, before its margin sank into negative territory in 2022 and 2023. The good news is that Shopify is on track to return to profitability this year, but it's anyone's guess whether its margins can rise back toward sustainable double-digit rates over the next few years.

Price and risk

As you might expect, Shopify's stock is valued at a big premium that reflects Wall Street's enthusiasm for the company. You'll have to pay 15 times sales for this business. That's far above Amazon's price-to-sales ratio of 3. It is also much more than you'd pay for the highly diversified, established, and profitable company like Microsoft, for example. That business is valued at just over 13 times revenue.

Many investors, then, will prefer to have Amazon in their portfolio over Shopify. You'll expose yourself to much less risk thanks to that lower valuation. Furthermore, Amazon's ample cash flow and profits are attractive. The two growth stocks are likely to be setting sales and earnings records in a few years. But Amazon has more going for it as an investment opportunity right now.