Lately, more and more experts are predicting a recession. Many of them are billionaires, so you'd think they would know. Even a few investment banks have begun to sound the alarm about the rising risk of economic contraction. But no one can predict the future. 

If there is a recession, some stocks will suffer worse than others. That's why it's important to have a diversified portfolio including companies that have products and services people tend to pay for even when they are pinching pennies. Rollins (ROL 0.17%) and Pool Corp. (POOL -0.49%) are two you can count on. 

A family and grandparents relaxing in a tropical backyard while young kids play in the pool.

Image source: Getty Images.

1. Rollins

When you think about things that don't change because of a recession, pest control has to be high on the list. And the company responsible for the Orkin brand -- along with many others -- is one of the most reliable businesses around when the times get tough. Looking at the past quarter-century of revenue, it's difficult to spot the three recessions. 

ROL Revenue (Annual) Chart

ROL Revenue (Annual) data by YCharts

That's because the company continued to grow. In fact, the company has had only one year-over-year revenue decline in the past three decades. Of course, it's also never grown faster than 14%. Rollins posted 12% growth in 2021.

Chart showing 30 years of annual revenue growth with only 1997 being negative.

Data source: Rollins. Chart by author.

That consistency has led to a premium valuation. Other than a brief dip in March 2020, the stock hasn't traded below a price-to-earnings (P/E) ratio of 45 since the beginning of 2017. If it meets analysts' expectations for this year, the current price represents a forward P/E of 47.5. It's not cheap. But you aren't often going to get a bargain on a business as dependable as Rollins. 

2. Pool Corp.

Getting outside during the pandemic led to surging demand for outdoor activities, especially at home. That transformed steady-growing Pool Corp. into a growth stock. Sales climbed 64% in the half-decade preceding the pandemic. In the past two years, revenue has jumped 66%.

Unlike many companies that benefited from COVID-inspired changes, Pool Corp. will keep reaping the rewards. Maintenance and repair make up the bulk of the spending associated with owning a pool. New construction, in contrast, counts for about 15% of consumer spending on pools. Although construction of new pools shot higher in 2020 and 2021, much of the value to shareholders will come in the recurring revenue over the next decade.

graph showing pools constructed by year.

Data source: Pool Corporation. Chart by author.

For example, annual new pool construction still pales in comparison with the housing bubble of the mid-2000s. But annual revenue has more than tripled for the company over that time, growing 241%.

Management expects the good times to continue. Sales are slated to grow between 17% and 19% this year. That's despite a tight labor market and a potentially cooling housing market.

Since 2014, the stock has only briefly traded as low as 24 times earnings per share. Assuming the company matches estimates for its first quarter when it reports later this month, it currently trades at a price-to-earnings ratio of about 25. Like Rollins, Pool Corp. is a stock to add whenever you get a fair price and hold for decades.