It's been a wild ride for the tech sector over the past few years. After dropping 30% at the beginning of the pandemic, the Nasdaq Composite rose 134% through the end of 2021 and then fell another 36% during 2022. These severe market movements brought with them a tech bubble that sent valuations through the roof, and a crash that made every tech stock look like a bad investment.

The key to weathering this market mayhem is to buy strong businesses and hold them for the long term. Companies with strong fundamentals will experience volatility, but over time investors will be rewarded. With prices still somewhat discounted from recent highs, here are two tech stocks investors can buy and hold for the next decade.

1. The Trade Desk

The Trade Desk (TTD 0.36%) is the leading programmatic advertising company on the buy side of the ad ecosystem. Ad agencies and brands come to The Trade Desk's platform to buy ads, and the results suggest this trend will continue. Since 2015, The Trade Desk has never had a year with revenue growth below 30%.

Management believes that over time, all advertising will switch from linear TV to connected TV. This shift is happening because consumers are moving to connected TV and because the data provided by digital ads is superior to non-digital ads. As this shift accelerates, The Trade Desk should benefit as it's growing to become the premier platform to sell digital ads on connected devices.

There's also a large international opportunity The Trade Desk has only started to capture. In 2022, 90% of the ad spend on The Trade Desk's platform came from North America. However, two-thirds of ad spend globally takes place outside of North America. As The Trade Desk seeks out more international business, investors can rest assured the company's growth is far from over. 

2. Cloudflare

Cloudflare's (NET -0.38%) mission is to make the internet better. One of the ways this is accomplished is by building an edge network. Put simply, by building infrastructure all over the world, Cloudflare is bringing the internet physically closer to end users, increasing speed and performance. 

Results would suggest customers are happy. Cloudflare ended 2022 with more than 162,000 customers, up 16% over 2021. Even more important to Cloudflare is its large customers, who make up more than 60% of the company's revenue.

These large customers, defined as those with $100,000 or more in annualized revenue, have grown 146% since 2020. Taking it a step further, customers spending $500,000 or more and $1 million or more have grown 213% and 166%, respectively, over that same time frame.

The internet is going to continue to grow and Cloudflare estimates its total addressable market will be $135 billion in 2024, driven by things like 5G and the Internet of Things. With 30% of the Fortune 1,000 as customers, Cloudflare is proving to the largest businesses in the world that it is perfectly positioned to seize this market opportunity.

3. Datadog

Like Cloudflare, Datadog (DDOG -0.76%) has also seen rapid customer growth in a growing market. Global cloud spend is expected to grow to $1 trillion by 2026, and represent 20% of all IT spend. By comparison, cloud spend in 2021 was $400 billion and accounted for only 8% of total IT spend. 

Datadog has grown its customers and won over its users by providing a single point where businesses can monitor all of its IT monitoring. This allows employees in various parts of a business's IT department to see everything in one place, eliminating the silos that have existed traditionally. 

Since 2020, Datadog has grown its customers 63% and in Q4 of 2022 its dollar-based net retention rate was greater than 130%. Put simply, more customers are coming to Datadog and they're spending more once they arrive. 

This increased spend by existing users is also evident in the number of customers using multiple products. As of the end of 2022, 42% of customers were using four or more products, and 18% were using six or more. Those percentages were 33% and 10% at the end of 2021.

With the expected growth of cloud spend and the expanding percentage of global IT spend transitioning to the cloud, Datadog has a bright future. Over the next decade, it should be able to continue to take market share, rewarding shareholders along the way.