A tumultuous end to 2018 and a slow start to 2019 have some market analysts whispering about a threat that was seldom mentioned during the longest bull market run in financial history: a recession. And while a recession is far from a sure thing, it's worth looking at how one might affect Amazon (NASDAQ:AMZN), a company like no other.

No company can count on doing particularly well in a recession, but certain subsets of the economy are known to be better insulated than others. One such subset is the grocery store business, which tends to weather recessions reasonably well as people have to buy food no matter how the economy is doing. Amazon is certainly not a grocery store, but it does own one (Whole Foods), and it does sell groceries on Amazon.com. Can those holdings become a hedge against possible economic downturns?

A cart moving down the aisle of a grocery store.

Source: Getty Images.

How groceries fit into Amazon's business strategy

Amazon started as an online bookstore, but it quickly shed the limitations that came with that and became an "everything store." If it could be shipped, Amazon would sell it (or would help a third party to sell it to you) on Amazon.com. And as Amazon grew and leveraged its size while cutting shipping deals, more and more things became cost-effective to ship. Those included groceries and home supplies such as detergent, which Amazon started selling under its Prime Pantry program. (Amazon also sold things that were not cost-effective to ship, but it has recently made efforts to become more profit-minded with its offerings.)

Amazon acquired Whole Foods in 2017. In the deal valued at $13.7 billion, Amazon gained everything Whole Foods had to offer, from its branding to its 475 brick-and-mortar grocery stores. Amazon is planning to add more Whole Foods stores around the U.S.

In addition to its physical grocery store options, Amazon is pushing hard in the online grocery shopping market. Whole Foods groceries can be ordered from Amazon Fresh and Prime Now, which are Amazon's grocery delivery and same-day delivery programs, respectively; and Whole Foods groceries are no longer available through online delivery competitor Instacart.

All of this matters to Amazon, but it's important to keep perspective and remember just how big Amazon is. Amazon hit $1 trillion in market cap last fall. It's worth more like $815 billion as of this writing, but that's still nearly 60 times the value of the Whole Foods deal.

In the third quarter of 2018, Amazon reported $4.25 billion worth of sales from all of its physical stores (including its bookstores, pop-up stores, and Whole Foods stores), which was dwarfed by online sales of $29 billion. Of course, Amazon sells groceries online, but even Amazon optimists cite numbers that put Amazon at $2 billion in total online grocery sales for all of 2017.

For comparison, Amazon Web Services brought in $6.68 billion for Amazon just last quarter. With that said, Amazon is the top dog in the online grocery sales market -- it's just that the online grocery sales market isn't that big, at least not yet.

That doesn't mean that it won't be nice for Amazon if its groceries sell well during an economic downturn, but it does mean that some perspective is useful. To be a meaningful hedge against broader weakness, Amazon's grocery business will need to grow.

That "whole paycheck" image

When thinking about how Amazon's grocery business will do in an economic downturn, it's also worth noting that Whole Foods is arguably not as well-positioned as other grocers to weather tough economic times because of its higher prices.

Consumers need groceries no matter how the economy is doing, but Whole Foods is not a typical grocery brand. It's a premium brand, and premium brands rely more on consumers' disposable income. Whole Foods has only around 2.5% of the grocery store market, which is well behind Walmart (NYSE:WMT), a big Amazon rival that has more than 5,000 physical locations (more than 10 times as many as Whole Foods has) and a 23% market share in groceries.

Of course, Amazon can try to reposition its grocery offerings -- especially online.

Online grocery shopping and Amazon's future

Right now, Amazon's grocery offerings don't seem like much of a bulwark against recession. But the company is moving in the right direction: As it grows its grocery business and targets audiences less interested in premium grocery offerings, it is getting a bit of insurance against troubled economic times and turning up the heat on rival Walmart.

Walmart still has the inside track, of course. It has far more locations, and it is improving its online grocery shopping options and delivery services. And while Amazon is ahead online, groceries remain something that most people buy in person. Some observers expect online grocery shopping to make up just 20% of all grocery sales by 2025, leaving 80% of sales for in-person shopping.

But 20% of grocery sales is still a lot of money, and Amazon is in a position to dominate that market with an established customer base and more than 100 million Amazon Prime subscribers to work with.

John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Stephen Lovely owns shares of Amazon. The Motley Fool owns shares of and recommends Amazon. The Motley Fool has a disclosure policy.