The United States officially entered a recession earlier this year, as the COVID-19 pandemic shut down businesses nationwide. This recession is unusual since it was caused by a public health crisis instead of macroeconomic problems, and it's unclear if the economy will rebound after the pandemic ends.

Nonetheless, investors should stay vigilant and keep a few recession-proof stocks in their portfolios. Let's focus on three names that should hold up well during an economic slowdown: Procter & Gamble (PG -1.84%), Dollar General (DG -0.84%), and Veeva Systems (VEEV 0.01%).

A yellow road sign that says Recession Ahead

Image source: Getty Images.

1. Procter & Gamble

P&G owns a broad portfolio of billion-dollar consumer brands like Bounty, Charmin, Crest, Head & Shoulders, Gillette, Pampers, Pringles, and Tide. It's raised its dividend annually for over six decades, making it an elite Dividend King (a company that has raised its payout for at least 50 straight years).

P&G announced its latest dividend hike in the midst of the COVID-19 outbreak in April, and it currently pays a forward yield of 2.4%. It can raise its dividend consistently every year because the demand for its consumer staples stays steady throughout economic expansions and recessions.

Moreover, disasters and public health emergencies often boost sales of its products. That's why its organic sales rose 6% in fiscal 2020, which ended in late June and benefited from pandemic-induced shopping, and its core EPS grew 13%. For fiscal 2021, it expects its organic sales to rise 2% to 4% and for its core EPS to grow 3% to 7%.

P&G's forward price-to-earnings (P/E) ratio of 25 isn't cheap relative to its growth, but its wide moat, stable cash flow, and ability to grow through stomach-churning downturns all justify that slight premium. P&G delivered a total return of more than 200% over the past decade, and it should continue delivering stable gains through the next few recessions.

2. Dollar General

If a recession hits, cash-strapped consumers will shop more frequently at discount retailers. Dollar General, which mainly operates discount stores in rural and suburban areas, is well-poised to capitalize on that shift.

Dollar General expanded its store count from 2,059 to 16,368 locations between 1995 and 2019. It expanded throughout the Great Recession and the subsequent "retail apocalypse," and its focus on less densely populated regions insulated it from rivals like Amazon, Walmart, and Dollar Tree.

Dollar General's comparable-store sales rose 3.9% last year, marking its 30th straight year of comps growth, and its adjusted earnings grew by nearly 13%. It expects that momentum to continue with 2.5% to 3% comps growth and 10% earnings growth in fiscal 2020, which started in late January.

Dollar General pays a forward dividend yield of 0.8%, and it's raised that payout for four straight years. That dividend probably won't attract serious income investors, but it still contributed to Dollar General's total return of nearly 600% over the past 10 years. Dollar General's stock also isn't cheap at 24 times forward earnings, but its long-term resilience justifies that premium.

3. Veeva Systems

A high-growth cloud stock that trades at over 100 times forward earnings seems like an easy target for the bears during a market downturn, but Veeva's stock nearly doubled this year throughout the COVID-19 crisis.

Woman in mask and gloves examines a medical capsule.

Image source: Getty Images.

Veeva is insulated from recessions for three reasons: It consistently generates double-digit revenue and earnings growth, it dominates a high-growth niche, and that niche is nearly impervious to macro headwinds.

Veeva's cloud-based services help pharmaceutical giants like GSK and AstraZeneca track customer relationships, industry regulations, clinical trials, prescribing habits, and other data. Tracking that data in real time helps drugmakers remain on the same page, and escalating competition across the industry fuels Veeva's long-term growth.

Veeva established a first mover's advantage in this niche and doesn't face any meaningful competitors. Veeva's revenue rose 28% in fiscal 2020, which ended in late January, and its adjusted earnings grew 34%. For fiscal 2021, it expects its revenue to rise 25% to 26%, and for its adjusted EPS to grow 14% to 16%. It also reiterated its goal of generating $3 billion in annual revenue by 2025 -- compared to its $1.1 billion in revenue in fiscal 2020.

That refreshingly clear guidance arguably justifies Veeva's premium valuation. Veeva is certainly a riskier play than P&G and Dollar General, but it could remain just as resilient during a full-blown recession.