Many investors have faced significant headwinds through the first quarter of 2022. Only two of the 11 S&P 500 market sectors -- energy and utilities -- have generated positive returns, while the information technology sector has plunged nearly 15%. Collectively, the S&P 500 is about 8% off its high.

That's the short-term situation for the S&P 500. Over the longer term (30 years or so), the market has generated an annualized return of 8.2%, and that's despite weathering several downturns. What savvy, long-term investors have come to learn is that broad-based market sell-offs often present a great opportunity to put money into the market to generate outsized gains.

For instance, digital transformation should make Datadog (DDOG 1.19%) and Arista Networks (ANET -0.80%) unstoppable in the years ahead, and both stocks look like smart investments. Here's why.

IT specialist monitoring three different computer screen.

Image source: Getty Images.

1. Datadog

Datadog specializes in monitoring and analytics. Its cloud software helps businesses keep tabs on their applications, networks, and infrastructure by ingesting trillions of signals each day. Its platform then leans on artificial intelligence to make sense of that information, identify problems, and surface actionable insights, thereby preventing (or minimizing) downtime in business-critical systems.

Datadog is designed to be cloud-agnostic and easy to deploy. Its software runs across private data centers, public clouds, and multi-cloud environments. It also features 500 built-in integrations, accelerating time to value for clients. Better yet, it allows clients to monitor their entire IT ecosystem from a single dashboard. That value proposition has fueled impressive financial results.

Datadog's customer base increased 33% to 18,800 last year, and its retention rate stayed above 130%, meaning the average customer spent in excess of 30% more. Thanks to the success of its land-and-expand growth strategy, revenue surged 70% to $1 billion in 2021, and free cash flow hit $251 million, up from $83 million in the prior year. But with a market opportunity of $53 billion by 2025, shareholders have good reason to believe that momentum will continue.

Datadog has continuously evolved its product portfolio over the years -- for instance, it launched cloud security tools in 2021 -- and management still sees room to expand into new categories like real-time business intelligence, developer workflows, and IT service management. Additionally, IT environments will only become more complex in the years ahead as enterprises continue to invest in digital transformation. That should be a powerful tailwind for Datadog.

2. Arista Networks

Arista specializes in high-performance networking solutions -- the switching and routing platforms that power modern data centers. Its technology allows clients to deploy fast and scalable networks across their entire IT ecosystems, from the cloud to the enterprise campus. It also provides solutions for network monitoring, automation, and security, which collectively simplify network management for IT teams.

Arista has differentiated itself from industry-leader Cisco Systems in two key ways. First, its Extensible Operating System (EOS) runs across its entire hardware portfolio, while Cisco uses different operating systems -- one for data centers, another for the enterprise campus -- which makes network management more complicated. Second, Arista does not build its own semiconductors; instead, it sources all of its silicon from third-party vendors like Intel, which keeps costs down and gives its clients more flexibility. Cisco, on the other hand, does design its own chips.

That edge has helped Arista win customers like Microsoft and Meta Platforms, and it has fueled consistently solid financial results. In 2021, revenue rose 27% to $2.9 billion, operating margin rose 118 basis points to 31.4%, and free cash flow climbed 32% to $951 million.

Last year Cisco captured 41% of spending in the broader data center switching space, down significantly from 78% market share in 2012. Meanwhile, Arista has grown its market share from 4% to 19% over the last decade. More importantly, Arista leads the pack at the speedier end of the spectrum, meaning 100-gigabit switches and above. That's important because digital transformation initiatives -- think cloud adoption and the ever-growing number of connected devices -- will continue to put a strain on data centers, making faster networking solutions a necessity.

On that note, management puts the company's market opportunity at $29 billion by 2023, leaving plenty of room for growth. That's why this growth stock looks like a smart long-term investment.