Technology stocks were the key to the stock market's 13-year bull run that began to stall in November. Starting in late 2009 following the collapse of the financial markets, the tech-laden Nasdaq Composite index returned almost 1,000% compared to a 610% gain by the Dow Jones Industrial Average and a 550% rise by the S&P 500.

It's been a different story since November, however, as rampant inflation, a Federal Reserve intent on raising interest rates to thwart rising prices, and a malfunctioning supply chain system have conspired to send high-flying tech stocks lower.

The Nasdaq exchange at one point tumbled more than 20%, decidedly putting it into bear-market territory, and even though it's cut that deficit in half in recent weeks, it's still much easier to find bargain-priced tech stocks today than it was at the start of the year. 

The following pair of stocks represent some of the best tech companies to buy today and hold for years to come.

Child using a tablet.

Image source: Getty Images.

Roblox

Online gaming platform for kids, Roblox (RBLX 1.60%) has developed a thriving ecosystem that features almost 55 million daily active users and produced $1.9 billion in revenue last year, but it's still generating losses ($143 million in 2021), and growth slowed considerably after the massive run-up during the lockdown phase of the COVID-19 outbreak. 

In part, that's the reason Roblox stock lost two-thirds of its value since peaking at $141 a share in mid-November as investors fear its best growth days may be behind it.

That seems shortsighted.

First, video games are still hot even if they're not at the fever pitch they were two years ago. U.S. consumers spent over $60 billion on video games last year, 8% more than they spent in 2020, and over twice as much as they spent on other forms of digital entertainment such as streaming video.

Video game companies are also a hot commodity with Take-Two Interactive agreeing to buy Zynga for $12.7 billion and Microsoft showering $70 billion over Activision Blizzard to acquire it. 

The real growth potential of Roblox, though, lies in the metaverse, the virtual world where people can interact with one another, play games, or even conduct business. It's perfectly positioned to capture the growth in the virtual world because it already creates such environments for users of its existing gameplay.

Roblox growth is impressive even before the metaverse becomes a reality, and the slowdown now is really more of a reversion to the mean. As the metaverse grows, expect Roblox to be there for early users in terms of both age and time.

Worker checking laptop amid bank of servers.

Image source: Getty Images.

Digital Realty

Though Digital Realty (DLR 0.63%) is not your typical tech stock, it could be one that pays off handsomely now and for years to come because it is being lumped in with the overall sector and beat up accordingly.

Digital Realty is the 800-pound gorilla in the real estate investment trust (REIT) market focusing on data centers; it owns more than 280 data center facilities in almost 50 key metropolitan areas across 25 countries. In fact, the field has narrowed to just two such REITs, and the market for them is rapidly expanding.

The REIT's bookings, a proxy for rental income, soared to $154 million in the fourth quarter, three times greater than what they were just five years ago, and it's likely only to intensify as the national rollout of 5G network infrastructure picks up steam. 

Adjusted funds from operations (AFFO), a critical profitability metric for REITs, increased 7% to $6.25 per share last year, up from $5.82 per share a year ago, primarily due to the expansion of Digital Realty's PlatformDIGITAL service -- its global data center platform in the cloud.

Of course, dividends attract investors to the data center REIT because, like all REITs, the company is obligated to pay out 90% of its profits to shareholders as dividends. Digital Realty's annual dividends of $4.64 per share currently yield 3.5% with a payout ratio of 76%, which still allows for reinvestment in the business while continuing to reward shareholders in the future.

As the biggest fish in a small pond and a world of opportunity still available to it, Digital Realty's loss of more than one-fifth of its value since November is a discount that investors shouldn't pass up.