The retail apocalypse has been under way for years. Online retailers and big-box superstores are stealing market share in the American and global consumer shopping sector every day, and the coronavirus pandemic only accelerated this unstoppable megatrend. Many store chains are filing for bankruptcy and closing stores, your local shopping mall probably looks like a ghost town, and the retail industry is rebuilding itself as we speak.

But it's not game over for every old-school retailer. Some are actually thriving in this difficult business environment and you should consider adding them to your investment portfolio today. These household names have built two very different but equally apocalypse-proof business models.

A young woman using a smartphone. Five gold stars hover in the air over the phone.

Image source: Getty Images.

1. Target: If you can't beat 'em, join 'em

Big-box retailer Target (TGT 1.03%) was a turnaround story five years ago. Threatened by online giants led by Amazon, the company embraced the idea of digital sales portals where centralized shipments were supported by same-day pickups from a local Target store. The company also acquired same-day delivery specialist Shipt during this period of strife for $550 million.

Sales started ticking upward again in 2017 as this e-commerce strategy evolved, setting the company up for success in the coronavirus-tinted age of social distancing and no-contact shopping experiences. Target's top-line sales trended upward in 2020 while most old-school retailers saw falling revenue, and the company's free cash flow showed explosive growth:

TGT Revenue (TTM) Chart

TGT Revenue (TTM) data by YCharts

Analysts now argue that Shipt could be worth $14 billion if Target decided to spin it out as a separate company. The retailer's operating engines are firing on every cylinder thanks to management's flexible approach to facing the challenges of e-commerce rivals and limited foot traffic in physical stores.

Target's stock is setting fresh all-time highs pretty much every week these days. The stock has gained 68% in 52 weeks and 173% in three years, running close to e-commerce titan Amazon over both time periods. Target earned every inch of these massive gains by delivering muscular business results along the way. Even now, the stock is trading at comfortable valuation ratios such as 16 times free cash flows and 22 times forward earnings.

Two young children wearing face masks and carrying large packages of bathroom tissue in a retail store.

Image source: Getty Images.

2. Costco: Playing by a different rulebook

Warehouse retailer Costco Wholesale (COST -0.24%) is a different story. This is where both businesses and consumers go when they need large amounts of items ranging from gas to groceries, from tires to furniture, from contact lenses to bathroom tissue. Anything counts in large amounts and that's exactly what you'll find at Costco.

Costco is also known for its low prices as well as generous employee pay and benefits. If that sounds like an unprofitable combination, you're not exactly wrong -- Costco's operating margin is inevitably skimpy even by the profit-starved standards of traditional retailers. However, the company also requires every shopper to sign up for an annual membership and that program is pure profit.

This is the secret sauce behind Costco's success. The company can afford to run its day-to-day operations very close to breakeven as long as shoppers are willing to pay those annual membership fees. In December's first-quarter report, membership fees added up to $861 million for 59.1 million paid households. Net income landed at $1.16 billion for the quarter, and the membership fees accounted for 74% of that bottom-line haul. That's not a fluke event but a predictable part of Costco's business plan.

Costco's stock has gained 15% over the last year and share prices doubled in three years. This stock is a bit more expensive than Target's, trading at 31 times free cash flows and 33 times forward earnings. Don't let that stop you from owning shares of this high-quality company. As master investor Warren Buffett says, "It's far better to buy a wonderful company at a fair price than a fair company at a wonderful price." That's what Costco gives you.