Costco (COST 2.05%) is the second largest retailer in the country, while Amazon.com (AMZN 0.80%) is easily the world's dominant e-commerce platform. These facts ensure that many consumers will be asking themselves some form of this question as they decide where to shop this holiday season: Amazon or Costco?

Investors face a similar choice in comparing the two successful businesses as stock buys. And, like the shopping match-up, there are pros and cons to each company.

A tablet computer showing charts and spreadsheets.

Image source: Getty Images.

The exciting option

If you're looking to add excitement to your portfolio, Amazon is the clear choice. Soaring cash flow growth has given the company flexibility to invest in all kinds of risky, but potentially profitable, long-term initiatives.

The Amazon Echo device.

Image source: Amazon.

Right now, these include devices marketed under the Echo and Fire brands that compete against consumer-electronics giants such as Apple and Alphabet, an Amazon Web Services division that's going up against cloud titans such as Microsoft, and a streaming service that aims to rival Netflix in its global reach. There's seemingly no end to the list of industries that CEO Jeff Bezos and his team are willing to target for disruption.

On the downside, it's not clear when, or if, any of these investments will deliver sustainable profit growth, and so Amazon's earnings outlook is highly uncertain. There are 21 Wall Street analysts who cover the stock, for example, and their estimates for 2018 profit range from $7.70 per share to $10.82 per share. Amazon's own prediction for the fourth quarter is so wide that it hardly qualifies as a forecast. Bezos and his team are targeting operating income somewhere between $300 million and $1.65 billion, which translates into either a 27% improvement or a 77% decline from last year's holiday season .

The safer bet

A Costco purchase doesn't expose investors to especially large, or exciting, growth. In fact, the warehouse retailer's expansion strategy is confined to steadily building out its store base while slowly adding to its e-commerce infrastructure. Compared with Amazon, whose projects now include amassing its own network of delivery aircraft, that approach can seem boring.

Yet the strategy has worked well for Costco over the long term. Its comparable-store sales consistently outpace rivals including Wal-Mart, Target, and Kroger. And unlike those retailers, Costco reliably improves its earnings haul each year, even during slower-growth periods like the one currently affecting the industry.

COST Net Income (TTM) Chart

COST Net Income (TTM) data by YCharts

Costco's profits come mainly from membership fee income, which is highly predictable given the retailer's 90% subscriber renewal rate. As a result, earnings have been above $2 billion in each of the past five fiscal years, and that haul has helped fund massive cash returns to shareholders. Sure, Amazon generated over $2 billion in net income in 2016. But the company has also posted a loss in two of the past five years and has yet to pay a dividend.

Ultimately, investors must weigh Amazon's uncertain but probably massive sales growth against Costco's predictable yet modest expansion opportunities. I prefer less risky investments, and that bias has me favoring Costco as a stock buy today.

On the other hand, an investor who's willing to accept unusually large profit swings might be happier owning Amazon, if only to benefit from whatever disruptive projects the company succeeds in launching over the decades ahead.