When it comes to data-center real estate investment trusts (REITs), there are only two pure-play stocks for investors to choose from: Digital Realty Trust (DLR -0.71%) and Equinix (EQIX 0.90%). Rising interest rates and a weakening economy have pushed both companies' share prices down 43% and 22% respectively this year. 

Because long-term trends favor this fast-growing industry, an investment in data-center REITs at today's discounted pricing could pay off handsomely 10 to 20 years from now. If you're wondering which stock is worthy of your investment dollars, here's a closer look at each company to determine which is the better buy of the two.

Same, but different

Both companies have a global reach, with their portfolios spanning multiple continents and major metro markets. Digital Realty Trust has more data-center facilities in its portfolio, roughly 300 in 26 countries, while Equinix has 249 in 32 countries. Digital Realty Trust wholly owns its assets, leasing space to about 4,000 tenants around the world. Equinix owns just 54% of its properties, which are leased to roughly 10,000 tenants. The rest are leased from other data center providers, including Digital Realty Trust.

Leasing properties gives Equinix a competitive edge, because it can provide service in markets that might have a high barrier to entry for developing data centers. It also requires less overhead as it develops property and allows it to reach more markets with fewer properties. However, this does make it susceptible to paying much higher lease rates in the future, which could affect its profitability.

As of third-quarter 2022, Equinix's leases had an average term of 18 years. Many have renewal and purchase options in the agreements, helping ease some of the rental increase concerns.

Equinix has roughly 443,000 cross connections, compared to Digital Realty Trust, which has 188,000. Cross connections are point-to-point connections between data centers that help deliver better pricing, speed, and efficiency to tenants through cross-connectivity. So the fact that Equinix has over double the connections of Digital Realty Trust is a major advantage.

Performance as of late

When it comes to data center performance, 2022 has been a challenging year. Rising interest rates have increased borrowing costs, while the strengthening U.S. dollar has eaten into overseas earnings. However, demand for both companies' data center services has never been stronger.

In the third quarter, Equinix saw its highest-ever net bookings, or new leases, helping boost revenue by 10% compared to last year. Its funds from operations (FFO) per share -- an important metric that illustrates REITs' profitability -- grew by 2% year over year. The company expects its full-year earnings to be roughly 9% higher than in 2021, which would be an extremely healthy rate of growth for a REIT.

Digital Realty Trust also delivered record quarterly bookings in Q3 2022. Its core FFO per share grew about 1% since last year, while revenue rose by 5% both quarter over quarter and year over year.

Digital Realty Trust completed the acquisition of South Africa-based data-center operator Teraco, which should add 22,000 cross connections by year-end. Equinix announced its $200 million investment in data centers in South Africa and Malaysia, which is scheduled for completion in 2024.

Which is the better buy of the two?

Price is a big determinant for many investors when it comes to buying stocks. Equinix has a higher price tag, trading for around $658 per share at the time of this writing compared to $101 Digital Realty Trust. Equinix's higher share prices could price some investors out of the market.

Equinix shares trade for roughly 22 times its price to FFO, while Digital Realty Trust is trading at about 15 times FFO. This means Digital Realty Trust is more favorably valued. Digital Realty Trust's dividend yield of 4.8% is also more than double Equinix's. 

Chart showing Digital Realty Trust's dividend yield beating Equinix's in 2022.

DLR Dividend Yield data by YCharts

Equinix has much lower debt ratios than Digital Realty Trust, which means it's less vulnerable to rising interest rates. It's also got more coverage for its dividend payouts than Digital Realty Trust, meaning if data-center demand or operations decline in the event of a recession, the company has more flexibility to maintain dividends and meet debt obligations. It's also worth noting that Equinix has outperformed Digital Realty Trust over the past three-, five-, 10-, 15-, and 20-year periods.

Both companies are solid stocks to own, giving investors exposure to the data-center industry through different global markets. I personally own shares in both companies and don't plan on selling anytime soon. However, if you can only buy one, I would buy Digital Realty Trust if you're looking for higher yields and better value. And I'd buy Equinix if you are looking for safety and steady growth over yield.