Your portfolio has probably fared well over the past year. Despite the planet-stunning nature of the pandemic, the economy's quick recovery made it easy to warm up to most consumer-facing companies. But where should your money go if things aren't going so well?

Roku (ROKU 0.15%), O'Reilly Automotive (ORLY 0.03%), and Costco (COST 0.17%) are some of the best recession-proof stocks to buy now. Let's see why I think they'll weather the storm when the economy starts to look stormy. 

Two people pushing a large piggy bank up an incline.

Image source: Getty Images.

Roku

Streaming TV at home has become comfort food, and it's a great way to entertain on a budget. There's a plethora of free or nearly free services out there, and Roku is the hub of choice for 53.9 million homes and counting. Roku offers thousands of available streaming apps, and it's never been easier to get on the free platform. 

Roku dongles cost as little $20 to $30, and if you're lucky, the smart TV you own may already come with Roku's operating system installed. Roku ships in 38% of the smart televisions sold in this country.

It's not just about access to all of the popular streaming apps from a single remote control, either. Roku has been beefing up its free ad-supported content offerings, a move that should increase engagement and user loyalty. With advertisers turning to connected TV marketing to reach the growing streaming video audiences out there, Roku can keep growing without costing you a dime out of your pocket. 

O'Reilly Automotive

If shiny new cars are a byproduct of a booming economy, what happens when our financial well-being goes the other way? We tend to hold on to our cars more when money's tight, and that's when O'Reilly Automotive starts to shine. The chain of 5,660 stores sells automotive parts, and that's historically been a good place to be when we need to maintain our aging cars. 

O'Reilly's a beast of consistency. It has rattled off 28 consecutive years of positive comps, and it's going to be easy to stretch that run to 29 years. Sales rose 25% in the first quarter, fueled almost entirely a 24.8% year-over-year surge in comps. The bottom line is growing even faster.

O'Reilly Automotive has proved itself to be a worthy all-weather winner. Even in a pandemic when we didn't spend a lot of time in our cars, the company still managed to keep its positive comps going and trounce Wall Street profit targets with ease over the past four quarters.  

Costco

Roku and O'Reilly Automotive don't pay quarterly dividends, something that investors typically expect out of recession-resilient investments. Let me try to course-correct this list by closing things out with Costco. The leading warehouse club operator -- and the world's third largest retailer -- isn't going make income investors excited with its modest 0.8% yield, but it knows how to keep the payouts coming. It has boosted its distributions every year since 2004, including a 13% increase just last month. Costco also declares chunky one-time dividends, including a $10-per-share special payout it shelled out to its shareholders last month. 

There are more than 105 million Costco members, and they're fanatical about the bulk-sized bargains they can find. Costco is a well-oiled machine with markups so meager on their products that membership fees nearly rival the 809-unit chain's bottom-line results. 

Costco didn't flinch in the early stages of the pandemic as an essential business, and it's not slowing down now that they year-over-year comparisons are starting to kick in. Costco's net sales soared 21.57% to $44.38 billion for the fiscal third quarter it posted on Thursday. Net income is growing even faster.

It's not easy to invest during a recession. Roku, O'Reilly Automotive, and Costco should help the sting with all-weather businesses that should thrive in good and bad times.