Most investors would agree that the surest path to generating long-term wealth is investing in top-quality companies and holding them for years, or even decades. Unfortunately, the recent volatility and the onset of a bear market have shaken some investors' resolve.

At times like these, it's important to remember that downturns are a normal part of the market cycle, and investing during steep declines more often than not yields above-average returns since investors are getting top-notch companies at significant discounts. But how do you single out the stocks that will supercharge your returns?

Identifying companies with the right combination of industry leadership, large and growing markets, and strong secular tailwinds can result in game-changing returns for investors that have the fortitude to buy and hold through the inevitable market gyrations. Here are two stocks that meet those lofty criteria. Investing $1,000 in each could be a genius move over the long term.

Okta: Identify verification takes on even greater importance

The surge of remote work a couple of years ago highlighted the growing importance of knowing who is accessing what systems and when. Having a strong front line that prevents unauthorized access to workplace systems became merely table stakes. That's where Okta (OKTA -0.10%) (pronounced Ahk-tuh) comes in.

Okta is a cloud-first provider of independent identity verification and access management, delivering a unified solution that secures systems used by employees, customers, and even contractors. The company's zero-trust model helps prevent the data breaches that so often make headlines. Okta integrates with more than 7,000 business software applications, offering everything from a single, secure login to more complex multi-factor authentication. More than 15,800 global organizations count on the company to handle their access and identification protocols. 

You don't need to take the company's word for it. Okta was named an industry leader in access management for the fifth consecutive year by research company Gartner, the best performer in its high-profile Magic Quadrant. That conclusion was echoed by Forrester Research, which named Okta the top Identity-as-a-Service (IaaS) provider for enterprise. 

The need for Okta's services has never been greater. During its fiscal 2023 first quarter (ended April 30), revenue grew by 65% year-over-year, fueled by subscription revenue that grew 66%. Okta's remaining performance obligations (RPO) -- which represents unbilled subscription revenue -- grew 43%. The current portion of RPO was even more impressive, up 57% year-over-year, which captures the company's near-term growth opportunity. Okta isn't yet profitable, but its strong free cash flow should reassure investors that that the losses are driven by non-cash items, such as depreciation. 

This could be just the beginning. Okta generated revenue of $1.3 billion in fiscal 2022, which is a drop in the ocean compared to its total addressable market, which management calculates at $80 billion. 

Take this (data) dog for a walk

The digital transformation is ongoing, resulting in a measurable acceleration in cloud computing. Employees and customers alike rely on cloud-based systems that need to always be up and running, and unscheduled downtime can result in both financial and customer losses. Datadog (DDOG 1.19%) is a vital link in the proceedings.

The cloud-based, unified platform offers a host of real-time analytics and monitoring services that keep tabs on cloud operations -- including databases, servers, tool, and services -- detecting problems before they result in critical downtime. The platform goes a step further, identifying the source of the problem to prevent it from becoming a recurring issue.

Datadog has the respect of its industry and its peers, cited by Gartner in its 2022 Magic Quadrant as a Leader in Application Performance Monitoring and Observability. 

Business is booming. In the second quarter, Datadog reported revenue that grew 83% year-over-year, accelerating from the 51% gains it generated in the prior-year quarter. The company isn't yet consistently profitable, but it generates strong and consistent free cash flow. 

The financial results were fueled by strong customer growth, as its total client base of 19,800 grew 30%. More importantly for investors, Datadog's large enterprise customers are growing even faster: The number of customers generating $100,000 in annual recurring revenue (ARR) climbed to 2,250, up 60% year-over-year.

Additionally, once they experience the ease and utility of Datadog's solutions, customers tend to spend more with each passing year, as evidenced by the company's dollar-based net revenue retention rate, which has remained above 130% for 19 consecutive quarters and counting. 

And there's a lot more where that came from. Datadog generated revenue of $1.03 billion last year, which is a drop in the bucket compared to its total addressable market, which management estimates will top out at more than $53 billion by 2025. 

OKTA PS Ratio (Forward) Chart

Data by YCharts

A word on valuation

I'd be remiss if I didn't point out that this robust growth and future potential come at a cost. Okta and Datadog are currently selling at eight and 19 times forward sales, respectively, when a reasonable price-to-sales ratio is generally between one and two.

That said, each company has the winning blend of industry-leading position, large and growing addressable market, and strong secular tailwinds -- combined with strong revenue growth -- that make them buys, even at these higher valuations.