Stock market volatility has picked up in recent weeks, as the crisis in certain regional and international banks has made investors uneasy, and inflation has proven harder than the Federal Reserve expected to get under control. This means many investors are understandably hesitant to put any new money to work in this environment.

However, there are some companies that should perform well no matter what the economy or stock market does for the remainder of 2023. Here are two in particular that could be worth a closer look for long-term investors right now.

1. Realty Income: An ultra-resilient dividend stock with room to grow

Realty Income (O -0.12%) is a real estate investment trust, or REIT, that is designed to produce steadily growing profits year after year, and it has a nearly three-decade track record of doing just that. Since listing on the NYSE in 1994, not only has Realty Income increased its dividend more than 100 times (with no dividend cuts), but it has handily outperformed the S&P 500 in terms of total investor returns.

The secret sauce here is surprisingly simple: Realty Income acquires single-tenant properties that are net leased to top-quality tenants. About 80% of its portfolio is occupied by retail tenants, but it also owns industrial, agricultural, and gaming properties. And the vast majority of the tenants are recession-resistant, not easily disrupted by e-commerce, or both.

Just to name a couple of examples, Walgreens is a top Realty Income tenant, and sells products that people need no matter what the economy is doing. FedEx provides a service that needs a physical location. And Dollar General sells products at discounted prices that even the top e-commerce retailers can't match.

Realty Income owns about 11,700 properties and is the largest net lease REIT in the market, but this is a multitrillion-dollar real estate market, and there could still be plenty of room to grow.

2. Life Storage: Valuable real estate with an incredible cost structure

You might be surprised to hear it, but the hottest commercial real estate subsector in the past few years has been self-storage. In simple terms, when the COVID-19 pandemic hit, people needed to free up space in their homes to create office spaces and generally saw more value in decluttering when they were home more often. And while self-storage properties lease space month to month in most cases, it becomes an essential, recurring expense for most people, with high switching costs.

Life Storage (LSI) can be a great way to invest in this trend, and it should hold up nicely during tough times. It recently reported 12% year-over-year revenue growth in its same-store portfolio, despite the tough 2022 environment. And the REIT continues to make value-adding acquisitions.

Life Storage also has a fast-growing third-party property management business that creates a capital-light revenue stream. Not only did the company add 107 stores to its management roster in 2022, 32 of them were formerly managed by its competitors, showing the strength of Life Storage's platform.

To be fair, it is certainly possible that demand for self-storage properties could cool off if the economy falls into recession later this year, as many experts are predicting. But even if this happens, it's important to keep in mind that self-storage operators have a very favorable cost structure, with minimal staffing and maintenance requirements relative to other property types.

In fact, fellow storage REIT Public Storage (PSA -0.80%) -- which has recently expressed interest in buying Life Storage -- has said its properties can break even with just 30% occupancy. Life Storage's occupancy is well over 90%.

These businesses should be just fine in 2023 and beyond

To be perfectly clear, these two businesses should perform just fine in 2023, even if the economy falls into recession. However, it's entirely possible their stock prices could be volatile in the short term, and if we see an unexpected level of economic weakness, that's exactly what I would expect.

But I'd think of any short-term weakness as an even more attractive opportunity to add shares of these excellent businesses to hold for the long haul.