Tech stocks have struggled recently, with the Nasdaq Composite index falling more than 23% year-to-date. Most of this smackdown has been because of recession fears in the U.S. Many investors are concerned about how tightening business budgets could impact tech stocks, especially those that do not provide mission-critical services to their customers.

However, finding and owning tech companies that provide those need-to-have solutions can be a great way to invest during this precarious time. Owning companies that offer products so necessary that demand won't soften, even during a recession, can deliver stellar returns as a long-term investor. If you want to invest this way, you might want to look more closely at Veeva Systems (VEEV -0.71%).

Scientist working on a computer in a laboratory.

Image source: Getty Images.

Veeva provides need-to-have solutions

Unless you work in the pharmaceutical industry, you have likely never heard of Veeva. It is one of the top providers of cloud-based software for the life sciences industry, helping pharmaceutical companies manage their operations faster and easier than manual processes.

Veeva's solutions help optimize everything a life sciences company may need, from clinical data management and operations to regulatory compliance on the research and development side. However, it also has commercial products that support customer data analytics. It even has customer relationship management tools that drive engagement. Simply put, Veeva's tools help life sciences businesses with the back-end processes for nearly every step of their operations.

Veeva is the far-and-away leader in this space. Over half of the top 20 pharmaceutical manufacturers use Veeva's research and development tools. Its eTMF tool -- a solution that manages a company's clinical documentation in real time to constantly maintain regulatory compliance and enable visibility and collaboration -- is used by 18 of the top 20 pharmaceutical companies.

Being the top dog has paid off for Veeva. Over the trailing 12 months, the company has generated over $1.9 billion in revenue and sported a staggering 40% free cash flow margin. The company expects to reach $2.17 billion in revenue in its 2023 fiscal year, which will end on January 31, 2023.

Demand should be sustainable (even through a downturn)

What's essential to know about Veeva is that its tools are critical for its customers. No rival offers the same widespread toolkit that Veeva does, so unless a business wants to have its data and information fragmented across multiple platforms, Veeva is their only choice. Therefore, these tools are unlikely to be dropped by customers, even during an economic downturn. 

The company's recent fiscal year has already started to back this up. In the company's 2022 fiscal year -- which ended January 31, 2022 -- the company had a net retention rate of 119% for its subscription services, signaling minimal customer churn and stable expansion in revenue per customer. 

The worst-case scenario for Veeva during an economic downturn would be that the company sees declining new customer adds, yet even that hasn't shown up in the company's financials so far. In fact, the company signed one of its biggest deals ever in its most recent fiscal quarter. A top-20 pharmaceutical company adopted 12 products, indicating that even with a possible recession on the horizon, businesses are willing to pay up for Veeva's tools.

How Veeva's dominance could translate into long-term success

While Veeva can thrive over the short term, it also has potential over the long term. The company is looking at $3 billion in revenue in the 2025 calendar year. That represents a 38% top-line expansion from its fiscal 2023 revenue guidance, which is considerable growth for a company that is already the top dog in an industry. 

Looking farther out, the company sees even more opportunity ahead. Veeva's total addressable market is worth $13 billion, multiples more than its current revenue.

Why Veeva is my top buy today

On an absolute basis, Veeva's valuation isn't cheap: The company trades at 45.5 times free cash flow. That said, this valuation is hovering near an all-time low since the company went public in 2013. Additionally, given Veeva's stellar cash flow margin and its dominance in the space, it might be worth paying up for this high-quality business. 

In this market environment, it can be extremely valuable to own businesses that can thrive in both the short and long run. Veeva looks like a company that can do that, which is why I own shares of Veeva and plan on holding them for a long time.