Concerns about a recession are top of mind for many investors, and not unreasonably so, given the macroeconomic factors at play these days. We aren't in one yet, but the National Bureau of Economic Research says a recession is a significant decline in economic activity spread across the economy, that lasts more than a few months, hits real GDP, and negatively affects income, employment, wholesale as well as retail sales, and industrial production. In 2022, the indicators are starting to line up.

For long-term investors, it's generally not useful to base an investment decision on the likelihood of a recession. Recessions happen, but they are generally short. Rather, finding companies that can thrive during good and bad economies and holding them for the long term is more in line with how they operate.

With that in mind, tech stocks like Snowflake (SNOW 1.21%) and Zscaler (ZS 1.04%) offer a lot of recession-resistant qualities and are worth exploring as investments. Let me explain.

Person thinking while looking at a laptop.

Image source: Getty Images.

1. Snowflake

Large enterprises often store their data on multiple cloud platforms, making it difficult to analyze the data as a whole. Snowflake fixes this problem by allowing businesses to consolidate their data into a single source that is platform agnostic. Its products are mission-critical because nearly every business needs to analyze the continuous stream of data it collects to improve operations and create competitive advantages. Snowflake's analysis services are in constant demand, which would likely continue throughout any economic environment. 

As a result, the company has continued to post stellar growth. In the first quarter of 2023 (ended April 30), revenue jumped 85% year over year to $422 million. Snowflake also expects product revenue to grow 66% for its full fiscal year. That forecast remained unchanged from its fourth-quarter outlook, which shows that, despite increasing concerns about businesses cutting back spending, the company does not believe that it will significantly affect its business. 

Snowflake is not immune to a recession. The company believes that some specific customers will be affected by macroeconomic headwinds. But this impact might not be as significant as investors are anticipating because the company primarily targets large enterprises, which are less sensitive to economic downturns than small businesses and thus less likely to substantially change their usage habits. With this customer focus and its essential product, Snowflake could be relatively resilient.

Even if there is some short-term volatility, the long-term for Snowflake is still bright. The company sees its total market opportunity worth $90 billion today, and despite these macroeconomic headwinds that could come, chief financial officer Mike Scarpelli said:

Consumption patterns may fluctuate from quarter to quarter. This variability does not detract from our long-term opportunity. Customers' overall demand for Snowflake remains unchanged.

With $172 million in free cash flow generated in the first quarter and a projected 16% adjusted free-cash-flow margin for the full fiscal year, the company will have plenty of cash to continue innovating and strengthening its service. At 27 times sales, the stock is by no means cheap. But you might not want to miss out on this high-quality business, so dollar-cost averaging into a position at lower valuations could be wise for the long term.

2. Zscaler

Cybersecurity is another recession-resistant industry that businesses would likely continue to spend money on during any economic environment. According to Zscaler, nearly 874 million phishing attacks were observed in the cloud globally in 2021, an increase of 29% from the prior year. This emphasizes the need for cybersecurity more than ever, and Zscaler is one of the top dogs in the industry. So it's poised to grow, even during a potential recession. 

Zscaler operates in the zero-trust space, ensuring that people are who they say they are when accessing sensitive business data or applications. It has more than 5,600 customers, including 30% of the Global 2,000 and 40% of the Fortune 500. 

Despite uncertain macroeconomic headwinds, Zscaler raised its guidance in its most recent quarter. It now expects $1.08 billion in revenue for its full fiscal year, which ends July 31. This is a 3% raise from the high end of its prior guidance and demonstrates the company's confidence in the continued demand for cybersecurity, no matter the economy.

There are other cybersecurity options besides Zscaler, and some might even be cheaper. So Zscaler could lose customers to those cheaper platforms during a recession. But cybersecurity is becoming so important that businesses might want to keep paying a premium for top-tier security platforms like Zscaler.

Like Snowflake, Zscaler trades at an expensive valuation of 21.5 times sales. That said, Zscaler is a dominant player in a market worth $72 billion today and likely much more in the future. While investors might have to pay a high premium right now, this company looks like it can thrive over both the short term and the long term if it can continue expanding its customer base and establishing itself as the leader in the enterprise market.