Last time the U.S. economy tumbled, from 2007 to 2009, some companies struggled more than others and some rose above the mayhem to report vibrant results. 

The same is likely to happen if the U.S. enters a recession later this year or next, a possibility increasingly being mentioned these days.

And one large-cap tech name may be better insulated than others: Amazon (AMZN - Get Report) , whose vast sales of low-cost goods could make it a champ in the event of a downturn. That in turn could lead the stock to outperform peers. 

As the Seattle company posted less-bad financial results during that recession, Amazon's stock outperformed both the market and large-cap peers.

The stock declined about 8% from December 2007 to June 2009, the official period of the Great Recession.

That was much better than the 36% drop in the S&P 500. It exceeded the stock performance at Google and Microsoft (MSFT - Get Report) , which was even worse than the S&P. And it was better than Apple's (AAPL - Get Report) 24% drop.

So how did Amazon's results shape up during that turbulent time?

Consider that from 2007 to 2009, the dropoff in Amazon's business was less drastic than it was at firms such as Alphabet (GOOGL - Get Report) , which then was called Google.

Google's revenue, composed almost entirely of economically sensitive advertising sales, saw its growth rate plummet to 3% by second-quarter 2009 from 42% midway through 2008. 

Facebook (FB - Get Report) back then was in the enviable position of being a brand-new ad player, and having a very small revenue base, it sailed through the recession in great form.

According to the company's IPO prospectus in 2012, Facebook's revenue soared 78% to $272 million in 2008 from $153 million in 2007 and then nearly tripled to $777 million in 2009. 

Now a more mature company, Facebook may well be vulnerable in the next downturn in the same way as Google. 

But Amazon held up well the last time things went bad.

In 2008, revenue growth plunged to 29.2% from the 38.5% level of 2007. But things never got as bad as they did at Google, even though, or perhaps because,  Amazon's revenue base was higher than Google's going into the recession.

The lowest sales-growth rate Amazon posted was 14.5%, in second-quarter 2009. That's almost five times the 3% that Google endured that quarter.

Amazon clearly felt the effects, and swiftly. And sharply. When revenue growth dropped to 18% in the December quarter of 2008 from 31% in the prior quarter, management attributed the decline in part to "decreased consumer demand following disruptions in the global financial markets."

Nonetheless, when Amazon reported in April 2009, at the tail end of the recession, management and Wall Street analysts were so upbeat during the conference call that it was hard to tell that anything bad was going on globally.

The most dire aspect of the recession that then-CFO Tom Szkutak acknowledged was that "higher-priced items are still growing, but certainly not growing as much as they were a few quarters ago."

Perhaps the most interesting factor about Amazon back then was that it had so many other pots on the stove that were going to become meaningful.

The company's logistics business, Fulfillment by Amazon, was still relatively new. It was a way to bring more third-party sellers to Amazon by streamlining their costs to fulfill sales.

How much it helped sales is difficult to measure because the business was still small, but it's at least possible that through that new stream of revenue, Amazon was able to ease the negative effect of the recession.

Even more important may be how Amazon fared in the broader retail context. Many mainstream department-store chains and high-end retailers struggled, and their suffering arguably accrued to the benefit to Amazon, which avoided the costs of individual retail locations in local markets. 

And then consider the Prime subscription business, which at the time had been in effect for several years. Back then Amazon didn't quantify the benefit Prime provided, but that subscription business may well have helped ease the recession's effect by instituting a consistent spending habit.

Prime could again play a role in smoothing things out should retail suffer another recession, as it has spread to more and more of the customer base. 

The simple fact is that Amazon contributes to economic growth in a big way. Its recent Prime Day shopping extravaganza is more than a brilliant PR blitz; it reportedly contributed to the July U.S. retail-sales outperformance in a meaningful way. 

Amazon surely is not recession-proof, but if times get tough again, its mantra of low prices plus a subscription shopping plan that keeps consumers hooked could be the recipe to make it recession-resistant, at least relative to large-cap peers.

Tiernan Ray neither trades nor owns any shares of any companies mentioned in this article.