In an effort to combat a swift rise in inflation, central banks have been hiking interest rates. That makes it more attractive to invest in things like CDs over dividend-paying stocks. For the most conservative investors, such a switch might make sense, but for investors with longer time horizons, it could be a risky decision. Specifically, the growing dividends you can collect from companies like Toronto-Dominion Bank (TD 0.46%) and Realty Income (O -0.17%) will help you keep up with inflation in a way that static CD interest payments can't. Here's a look at why these two dividend stocks look attractive today.

TD Bank's misstep won't derail the long-term story

Toronto-Dominion Bank has been around in some form since 1855. That's a very long history that includes a lot of good and bad times. The giant Canadian bank has survived them all, including rising-interest-rate environments like the one in place today. 

A person writing the word dividends.

Image source: Getty Images.

That said, the headline-grabbing negative right now stems from the bank's failed acquisition of First Horizon (FHN 0.07%) because of U.S. regulatory concerns about the way TD Bank handles money laundering oversight. It is highly likely that TD Bank weathers the storm as it works with regulators to better comply with expectations. After that, U.S. acquisitions will be back on the table again.

In the meantime, investors have punished the stock, which is now down nearly 30% from its 2022 highs. The yield is a very attractive 4.6%, backed by a dividend that has trended higher for decades. TD Bank, meanwhile, is one of the largest banks in Canada, providing it with a strong core. And it has a large position on the East Coast in the United States, giving it room to grow "south of the border." (It is a top-10 bank in North America.) There's also the not-so-subtle fact that the bank's Tier 1 Capital ratio, a measure of how well a bank can handle adversity, is the strongest you'll find in North America.

TD Chart.

TD data by YCharts.

Yes, TD Bank is dealing with headwinds, but it will most likely muddle through while continuing to reward investors with a growing dividend. That's worth looking into if you think in decades when you invest.

Building a business that can grow for years

Next up is net lease real estate investment trust (REIT) giant Realty Income. Net lease REITs own properties, but their tenants are responsible for most asset-level operating costs. Across a large portfolio, this is a fairly low-risk approach to owning real estate. Realty Income is huge, with over 13,000 assets and a market cap of roughly $40 billion.

To add to the REIT's bona fides, it has an investment-grade-rated balance sheet. And it has increased its dividend annually for 29 consecutive years. The dividend yield is 5.5% or so today. Despite the REIT's positive attributes, it still has to compete with other income options. Rising rates have been a big headwind for the stock, which is down around 25% from its 2022 highs.

O Chart.

O data by YCharts.

That said, Realty Income is generally afforded relatively attractive access to capital markets because of its size and strong operating history. It has the wherewithal to make big acquisitions that peers couldn't, and often at prices that would be uneconomical for smaller REITs. Moreover, it continues to expand its avenues for growth. For example, it has moved into Europe (geographic expansion), it has entered the casino property space (an example of adding new asset niches to the mix), and it has started to dip its toe into lending (broadening its investment options, financially speaking). This should help to set the REIT up for continued long-term growth. 

Realty Income is a tortoise, so it won't be exciting to own. But a slow and steady dividend stock is a pretty good option if you need reliable income in retirement. 

These stocks share one thing in common

Banks and REITs are different types of investments. But there is one attribute that TD Bank and Realty Income share -- they are both giants in their specific sectors. At a time when banks and REITs are under pressure because of rising rates, investors should probably take the opportunity to trade up to industry-leading names. Interest rates may move higher still, but you don't want to wait too long and miss an opportunity to own great companies like TD Bank and Realty Income while Wall Street is downbeat on the stocks.