While the market has recouped all of its losses from the February-March market crash, the global economy is still shaky. COVID-19 is far from over, and economies across the globe haven't recovered from the fallout. In the United States, unemployment was still 8.4% in August, while down from the April-high of 14%, is still way above the 3.5% before the pandemic. 

Some economists are still predicting a second market crash, and investors are strategizing about what stocks to buy today to prepare for that possibility. Costco (NASDAQ:COST) and Amazon.com (NASDAQ:AMZN) are great companies that shouldn't be affected by a second stock market crash.

Costco: Everything you need in bulk

It's no mystery why consumers love to shop at Costco. The huge warehouses feature bulk quantities of low-priced items, and members pay an annual fee of $60 for a basic membership, or $120 for an executive membership, for the privilege to shop there. Loyalty is high, with a more than 90% U.S. retention rate, and the company adds hundreds of thousands of members every quarter.

Grocery bags outside of a house.

Image source: Getty images.

The company operated 795 global stores, including 552 in the U.S., and it opened 13 warehouses in fiscal 2020. It also has a strong presence in Canada and Mexico, and a limited presence in several European and Asian countries, where it has lots of room to expand. Costco has built-in revenue generation in its fees, which make up a small portion of the total, but lead to the high sales that result from customers making the most of their memberships.

April was the first month in more than a decade that sales decreased year over year. Costco's non-essentials segments, including pharmacies and hearing aid clinics, were closed during lockdown, taking a chunk of revenue with them. But the full third quarter still increased 7.3%, showcasing the strength of essentials.

Fourth-quarter sales were up 12.5% despite the softness in travel and ancillary businesses. Costco is also succeeding in e-commerce, which rose 90% in the fourth quarter even though stores have reopened, and even more than the 65% third quarter increase.

Costco faces competition from discount retailers such as Walmart (NYSE:WMT) and Target (NYSE:TGT), but its differentiated model, with low prices and loyalty, almost guarantees growth. Costco stock is up 17% as of this writing and has returned more than 100% over the past three years.

Amazon: The king of e-commerce

Costco and Amazon both benefited from the pandemic as consumers focused on essentials and switched to online shopping, as did most other essentials providers like Walmart and Target. But Amazon sales grew 40% during the quarter ended June 30, as Prime members and other Amazon shoppers put their spending money in the name they have come to rely on. Amazon's decision to open up its platform to third parties proved to be an important factor in its success, as third-party sales grew more than first-party sales. 

Amazon's foray into other sectors, such as Amazon Web Services, has given it new ways to generate revenue. And AWS, with its high margins, also generates high income. Amazon has so much power at this point and such a large war chest that it can try new businesses without fear of failure. It has made several attempts to join the high-sales grocery category, and it keeps making headway, such as the launch of its Go stores and the new Fresh store that it piloted recently in California.  

Amazon's stock blew the others out of the water so far, with a fantastic year-to-date price return.

AMZN Year to Date Price Returns (Daily) Chart

AMZN Year to Date Price Returns (Daily) data by YCharts

Since it's trading at over $3,000 per share, it might seem like whoever doesn't own shares has already missed the Amazon boat. But, as seen over the past few months, Amazon's unbeatable in e-commerce and is leveraging its power to aim higher. In the case of another market crash, your money is safe with Amazon.