Real estate is a sector that tends to hold up better than most during recessions, but there is a wide range of subsectors that can be affected in different ways. For example, real estate investment trusts (REITs) that own hotels don't tend to perform well in recessions, as consumers spend less money on travel.

On the other hand, there are several types of commercial properties that are extremely resilient and should perform just fine even in a tough economy. With that in mind, here are three top-notch REITs that can be great additions to your portfolio, even during a recession.

Person with umbrella looking at dark clouds.

Image source: Getty Images.

1. Realty Income: Built for any type of economy

I've called Realty Income (O 0.11%) perhaps the best overall dividend stock in the market, and I stand by that statement. If you aren't familiar, Realty Income has grown from a single fast-food restaurant building in 1969 to a portfolio of more than 11,000 single-tenant properties in the U.S. and Europe. The REIT has made 622 consecutive monthly dividend payments to investors, has increased its payout for 98 consecutive quarters, and has delivered 15.3% total returns to investors annualized since its 1994 NYSE listing.

It may seem odd that Realty Income does so well in recessions, considering most of its tenants are retail in nature. But most properties are occupied by businesses that are recession resistant: Think grocery stores, convenience stores, pharmacies, and dollar stores, just to name a few. Realty Income has a 4.4% dividend yield that it pays in monthly installments, and this income stream should continue to grow for years to come.

2. Healthpeak Properties: Extremely resilient properties and excellent income

It's tough to make the argument that any type of commercial real estate is more recession-proof than healthcare. Simply put, healthcare tenants are on long-term lease agreements, and people need access to healthcare no matter what the economy is doing.

Healthpeak Properties (DOC 1.21%) can be an especially good candidate to buy in a recession. It invests in three types of properties in the healthcare space -- life science facilities, medical offices, and continuing care retirement communities. All three are resistant to recessions and should continue to grow in demand for the foreseeable future as the massive baby boomer generation ages. With a 4.1% yield, and lots of growth potential, this could be a great REIT to own in good times and bad.

3. Digital Realty: Not even a recession can derail this trend

Think about how many internet-connected devices were in your house just a decade ago. How many are there now? Within 15 feet of where I'm sitting, I can see a vacuum cleaner, printer, doorbell camera, speaker, and security system that are all connected. And that's not even including my computer and smartphone.

The point is that the volume and sophistication of the data flowing around the world is growing rapidly, and even in a recession, that isn't likely to change. And all of this data needs a place to live, which is where data centers come in. Digital Realty (DLR 1.97%) is one of the largest owners and operators of data centers in the world, and its customers are some of the biggest names in technology.

To be sure, Digital Realty's business might slow down during recessions as tech companies pump the brakes on new spending, but the long-term trend is intact. With a dividend yield of nearly 4% and a share price that's almost 30% below the high, Digital Realty is a great REIT to consider if you're worried about a recession.

These businesses should be fine, but...

As a final thought, it's important to point out that I'm saying these businesses should perform just fine in a recession. The stock prices, on the other hand, could certainly take a dive. And to be sure, if inflation gets even worse or if interest rates spike higher than the market expects, that's exactly what I would expect.

However, that's exactly what makes these REITs good buys during a recession. Buying businesses that continue to grow their profitability year after year at a discount can be an excellent way to create long-term wealth. In fact, when the COVID-19 pandemic first hit and the economy fell into recession, I bought shares of all three of these -- and if another recession starts, I'll likely add even more.