Amazon (NASDAQ:AMZN) has had a sluggish year in 2019. The stock has produced returns of just 17% thus far, which are uninspiring by its standards. By comparison, China-based Alibaba Group Holdings (NYSE:BABA) has gained 33%. The companies appear to be heading in opposite directions in terms of growth, and that's evident in their performances this year. However, let's take a closer look at which one is the better buy today.

Is Amazon investing too much into one-day delivery?

In October, Amazon's share price took a hit when the company's quarterly results failed to meet expectations, and guidance for the upcoming holiday season was also not as strong as analysts had been hoping. Regardless of whether management is simply being cautious or actually believes that a slowdown will take place, investors have pushed pause on buying the stock for now.

While the company was still able to achieve strong revenue growth of 24% during the quarter, Amazon is spending lots to get it. Not only has it invested over $800 million in one-day shipping during each of the past two quarters, but it's expecting to spend another $1.5 billion in Q4. The company is also going to be spending more on its sales efforts. With so much growth planned, investors might have hoped for stronger guidance.

Small delivery boxes on a laptop keyboard.

Image Source: Getty Images.

The problem is that these future-focused expenditures could hurt the company's present-day bottom line. While it's understandable that Amazon is spending money to make money, this could be a sign that doing so is becoming more expensive. The problem for Amazon is that historically, its profit margin just wasn't that strong to begin with:

AMZN Profit Margin (Quarterly) Chart

AMZN Profit Margin (Quarterly) data by YCharts.

And if it gets more costly to grow sales, that could make these margins even worse. Amazon always seems to find a way to continue to strengthen its profits, but at a whopping 77 times earnings, the stock might be a bit too rich for investors to buy it and wait for that to happen.

Can Alibaba keep its impressive growth going?

In its most recent quarterly results, Alibaba saw impressive revenue growth: Its top line reached 119.02 billion Chinese yuan ($16.91 billion) , which was a 40% improvement over the prior year. The numbers came in above analyst expectations in what was yet another strong quarter for the tech company.

Alibaba continues to see strong user growth, reaching 693 million annual active consumers, which is a 19% improvement from last period's numbers. However, the company still has some lofty hopes for the future, with Executive Chairman and CEO Daniel Zhang stating in the earnings release that "We aim to serve over one billion annual active consumers and help our merchants achieve over RMB10 trillion in annual gross merchandise volume by end of fiscal 2024."

It's an ambitious target that could prove to be very challenging, especially if the Chinese economy heads into a downturn. But if it does, then reaching those goals could send Alibaba's stock and market cap even higher. And if the company can maintain its high profit margins, which have been a lot stronger than Amazon's over the past few years, then the increase in sales will also give Alibaba's net income a big boost as well.

BABA Profit Margin (Quarterly) Chart

BABA Profit Margin (Quarterly) data by YCharts.

In addition, trading at a price-to-earnings ratio of more than 50, Alibaba is actually a slightly cheaper buy today, but not by much.

Better buy: Amazon

Alibaba is an intriguing option with lots of growth potential left. If it hits its five-year goals then the stock could be a great buy, but if it doesn't, its share price could flop. And given the risk involved with investing in Chinese stocks, specifically when it comes to the government, it may not be the safest bet for investors to make today. 

Amazon, meanwhile, is a company that's more of a sure thing and it's also taking a conservative approach, which I would agree is appropriate given the geopolitical uncertainty and economic conditions that could impact its future. Long term, Amazon's track record for finding new ways to grow makes it the more appealing buy, as it's unlikely that the company has run out of ways to add value for its shareholders.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.