Technology stocks have been among the best-performing sectors over the past month, second only to consumer discretionary stocks. Admittedly, the tech-laden Nasdaq 100 index is still down 19% in 2022, compared to a 13% decline in the S&P 500 and a 9% drop in the Dow Jones Industrial Average, but the rally indicates the sector is not dead.

Tech stocks carried the market on its nearly decade-and-a-half bull run before they were frozen out at the end of last year as traders switched to seemingly more recession-resistant names. But investors should ignore such short-term movements and focus on the long term, because technology is so ingrained in the global economy that it will still win out in the end. 

Padlock and chains over $100 bill.

Image source: Getty Images.

Use these sharp pullbacks to buy stocks that were previously unaffordable, scooping them up at a relative discount and then holding on for 10 years or more. The following pair of tech stocks are ones you can own for decades to come and reap the rewards from having bought them now.

PayPal

Payments giant PayPal Holdings (PYPL -1.84%) could easily fill a hole in the long-term tech holdings portion of your portfolio, as its growth is accelerating while the fintech industry is still in the early innings of its own trajectory higher. 

Although PayPal has seemingly been around forever (its IPO was in 2002), the payments business is only just beginning to hit its stride as the technology hits a critical mass. Consumers are using the service more than ever before. Payment volume jumped 13% this past quarter to $340 billion, with Venmo accounting for $61.4 billion in payment volume. PayPal processed 5.5 billion payment transactions for the period, while transactions per active account grew 12% to 48.7. That's up from 45.4 just six months ago and up from 40.9 at the end of 2020.

PayPal is one of the deans of digital payments and peer-to-peer money transfers, with an established brand that will continue to be a key player in the fintech market.

Alphabet

There's a lot to criticize Alphabet (GOOG -1.00%) (GOOGL -1.05%) over. But it's hard to argue that there are few companies more critical to the tech industry, or about how enmeshed it is in the social fabric of everyday life. That alone suggests it ought to be a long-term holding for investors.

Google, of course, owns internet search, accounting for 91.5% of all platforms, which is for all intents and purposes a monopoly. Second-quarter search advertising revenue on Google rose 13.5% to $40.6 billion, showing that advertisers will still go where the people are.

But Google isn't Alphabet's only revenue generator. YouTube is the most heavily trafficked website in the world, with 8.2 billion monthly visits, or almost three times more than second-place Wikipedia, and it contributed $7.3 billion in revenue. 

Alphabet's cloud services business Google Cloud could be where it sees the most growth in the future. It is the third largest cloud operation behind Amazon's (AMZN -1.54%) AWS and Microsoft's (MSFT -1.41%) Azure, and revenue surged 36% to $6.3 billion in the second quarter. 

Alphabet has lost almost 20% of its value this year, creating an opportunity to buy this stock at a discount and hold it for years.