Investors began backing away from tech stocks long before the broader market started declining. Where the S&P 500 is down over 22% in 2022, the tech-heavy Nasdaq 100 is down almost 30%, and really began falling back in November.

It seems no one wants to touch tech stocks right now. But that should provide savvy investors with an opportunity to get them at a discount because there are certain unbeatable trends just getting started that should offer substantial rewards in the years ahead.

Illustration of connected computer

Image source: Getty Images.

Cloud computing is one such sector and has been one of the hardest hit niches in this year's tech wreck. Yet it is also a niche that represents massive potential because it's expected to become a $1.5 trillion market by 2030.

The following two stocks represent an ideal combination of value and market-trouncing opportunity.

1. Amazon

We won't even discuss the e-commerce side of Amazon (AMZN -1.64%) -- but Prime Day is scheduled for July 12 and 13! -- because Amazon Web Services (AWS) is an enormous, profitable venture all on its own. It generated $18.4 billion in revenue in the first quarter, up 37% year over year, which should put it on track to handily surpass the $62 billion the segment generated last year. Operating margins also improved to 35% from 30% a year ago. 

AWS is the unquestioned leader in cloud-infrastructure market share with 33%, well ahead of runner-up Microsoft, whose Azure has a 21% share. (Alphabet's Google Cloud is a distant third with an 8% share.) 

More importantly, even as stocks in the sector were spiraling down in the first quarter, spending on global cloud services was roaring ahead, reaching $56 billion, a 34% increase from the year-ago period. And the top three names in the business, which control nearly two-thirds of the entire market, grew at a combined rate of 42% in the quarter.

The stock is down 35% year to date and 45% from the highs it hit late last year. However, with earnings expected to grow at better than 40% annually for the next five years and AWS holding the dominant position in the market, Amazon is a stock to buy now.

2. Digital Realty

Although it's not your typical cloud stock, Digital Realty Trust (DLR 1.50%) is a real estate investment trust (REIT) that also happens to be the biggest owner of data centers in the world, with over 290 across 26 countries. It's also the world's seventh-largest publicly traded REIT. 

Data centers are the backbone of the internet, serving as the nerve center for everything that occurs online or in the cloud. It doesn't matter whether it relates to e-commerce or Internet of Things devices accessing their network; data centers are the warehouses where the servers and networking equipment securely reside. 

And whereas data centers used to be a physical location, Digital Realty is also moving them to the cloud. Its PlatformDigital service is a global data-center platform that can serve as a hybrid solution that provides both scale and customization worldwide.

What makes Digital Realty doubly attractive is its dividend. As with any REIT, it is obligated to pay out 90% of its profits to shareholders as dividends. The company's annual dividend of $4.64 per share currently yields 3.8%. And its stock has been hammered like the rest of the tech sector.

Shares are down 27% this year, marking one of the lowest points since the start of the pandemic. Because businesses continue to move their data to the cloud regardless of economic conditions, Digital Realty is uniquely poised to capture more growth in the years to come, but its stock is one investors just might want to purchase now.