The stock market is near record-high levels, but the real estate sector has been a laggard, with many real estate investment trusts, or REITs, down considerably so far in 2017. However, there are some exceptions. Three REITs that have done quite well so far this year are AvalonBay Communities (NYSE:AVB), Digital Realty Trust (NYSE:DLR), and Welltower (NYSE:HCN). Here's some information about each, and whether they're still attractive buys now.

Company

Symbol

Recent Stock Price

Dividend Yield

AvalonBay Communities

AVB

$189.56

3%

Digital Realty Trust

DLR

$114.45

3.3%

Welltower

HCN

$71.27

4.8%

Data Source: TD Ameritrade. Stock prices and dividend yields are as of 8/9/2017.

Cash raining down on businesspeople.

These three REITs have delivered excellent returns for investors, but the best could be yet to come. Image Source: Getty Images.

Apartments in hot rental markets

When fewer Americans are becoming homeowners and more people are choosing to live in cities, it's a good time to be a REIT specializing in apartment communities located in high-barrier markets. AvalonBay Communities (NYSE:AVB) is such a REIT, with 287 apartment communities in locations such as Boston, New York City, Washington D.C/Northern Virginia, San Francisco, and Los Angeles.

These markets have limited supplies of apartments and strong rental demand. AvalonBay's core markets also have better-than-average wage growth and high household-formation rates. To illustrate this, over the past year, AvalonBay's existing apartments are bringing in 2.5% higher rent, on average, and occupancy is an impressive 95.4%.

AvalonBay's growth story doesn't appear to be over just yet. At the end of the second quarter, the company had 23 apartment communities under construction, which will add nearly 7,000 apartment homes to the portfolio and cost $3.2 billion. In addition, the company recently acquired two parcels of land that it intends to begin additional projects on in the coming months.

The need for data storage continues to rise

In full disclosure, data-center REIT Digital Realty Trust (NYSE:DLR) has been a major holding in my own portfolio for some time now, and it's produced some impressive returns in recent years. Even so, there's good reason to believe that the company's growth could still be in the relatively early stage.

Digital Realty owns and operates data centers -- 157 to be exact -- that are essentially buildings designed to house servers and network equipment in a secure and reliable environment. While the company has many clients, some of its largest customers are major tech players such as IBM, Facebook, and Amazon, as well as financial companies such as JPMorgan Chase.

There are a couple of reasons why I continue to have a positive long-term outlook for Digital Realty. For one thing, demand is growing faster than supply in many key markets. For example, in the Northern Virginia market, one of the largest data-center markets in the U.S., the current absorption-to-construction rate for data centers is 1.6-to-1. Furthermore, according to Cisco, global data-center traffic is expected to grow at an annualized 27% rate through 2020.

Senior housing could be an amazing growth market for decades to come

The coming opportunity in healthcare, particularly as it applies to caring for elderly Americans, is perhaps the most compelling of the three mentioned here. The U.S. senior-citizen population is expected to grow rapidly over the next few decades, including extreme growth in the oldest age groups. In fact, the 85-and-older population is expected to double in just 20 years.

Not only is Welltower (NYSE:HCN) the largest REIT that focuses on healthcare properties, but with 70% of its portfolio invested in senior housing and another 13% in long-term and post-acute-care properties, it stands to benefit more than most from the aging population.

In addition, it's important to mention that the current inventory of healthcare real estate is less than 15% REIT-owned, meaning that the industry is in the early innings of REIT consolidation. For reference, other property types, like hotels and shopping malls, are 40% or more REIT-owned. There could be lots of room for growth within the existing $1.1 trillion healthcare real estate market, as well. And Welltower's size and financial strength should allow it to pursue any attractive opportunities that arise.

Matthew Frankel owns shares of Digital Realty Trust. The Motley Fool owns shares of and recommends Amazon and Facebook. The Motley Fool recommends Cisco Systems and Welltower. The Motley Fool has a disclosure policy.