I've followed Veeva Systems (NYSE:VEEV), a provider of cloud-based services for life science companies, over the past few years. Its growth rate and wide moat impressed me, but the stock always seemed too hot to handle.

Two years ago, I called Veeva "one of the best long-term plays in cloud computing," but its forward P/E of about 100 prevented me from pulling the trigger on buying shares. Over the past two years, Veeva's stock has rallied more than 200% and it still trades at over 100 times forward earnings estimates. The stock surged through the escalation of the trade war between the U.S. and China and the spread of COVID-19, and recently hit an all-time high north of $270 per share.

When Veeva's stock pulled back to the mid-$250s, I finally bought shares of this high-growth company. Here are the three main things that persuaded me to buy.

A researcher wearing gloves and a mask examines a capsule behind an overlay of scientific symbols

Image source: Getty Images.

1. Its business is resistant to macro headwinds

Veeva co-founder and CEO Peter Gassner, who was previously Salesforce's senior VP of technology, saw an opportunity to build a dedicated life science platform powered by Salesforce's services.

Veeva's services help life science companies maintain customer relationships, track clinical trials and regulations, and analyze their data. It established a first-mover advantage in this niche, serving a growing list of customers that now is near 900, including pharmaceutical giants like AstraZeneca and Merck.

Competition among these drugmakers is fueling Veeva's long-term growth, and the company doesn't face any meaningful challengers yet. Therefore, it's insulated from recent headwinds like the trade war, tariffs, and the COVID-19 pandemic. Recessions also probably won't discourage drugmakers from accessing Veeva's services.

2. It has rock-solid growth rates

Unlike many other high-growth cloud service companies, Veeva remains consistently profitable by both generally accepted accounting principles (GAAP) and non-GAAP (adjusted) measures. Here's how stable Veeva's growth has remained over the past five years:

Metric

2016
Growth (YOY)

2017
Growth (YOY)

2018
Growth (YOY)

2019
Growth (YOY)

2020
Growth (YOY)

Revenue

31%

33%

26%

25%

28%

Adjusted net income

40%

45%

32%

72%

20%

Data source: Veeva annual reports. Veeva's fiscal year ends in January. YOY = year over year. 

Good past performance doesn't guarantee future gains, but Veeva offered a remarkably clear forecast for fiscal 2021, which ends next January, in its earnings report in late May. It expects revenue to rise 25% to 26% and non-GAAP earnings per share to grow 14% to 16%.

Veeva believes it will generate $3 billion in annual revenue by fiscal 2025, compared with just $1.1 billion in revenue in fiscal 2020. If Veeva hits that long-term target while expanding its margins, its annual earnings could easily triple.

3. It is constantly expanding margins

Veeva's non-GAAP gross and operating margins have consistently expanded every year:

Non-GAAP Metric

2016 Growth

2017 Growth

2018 Growth

2019 Growth

2020 Growth

Gross margin

67.2%

70.3%

71.3%

73.3%

74.7%

Operating margin

26.5%

29.4%

30.9%

35.6%

37.3%

Data source: Veeva annual reports.

Veeva's rising gross margins indicate it has plenty of pricing power. Its expanding portfolio of subscription services consistently achieves a retention rate of over 100% (121% in 2020), which means its customers remain locked in and are ripe for new cross-selling strategies.

Veeva didn't offer any gross margin guidance for 2021, but the midpoint of its forecast implies its operating margin will dip slightly to 36.4%. However, Veeva mainly attributes that contraction to the temporary impact of COVID-19 on its newly acquired Physicians World and Crossix segments, which partly rely on in-person meetings and events.

But after Veeva overcomes that near-term headwind, analysts expect its revenue and non-GAAP earnings to both rise 20% in fiscal 2022.

The bottom line

I plan to accumulate more shares of Veeva over the next few months. Its valuation is high, but I believe investors will continue to pay a premium for its robust growth, wide moat, expanding margins, ambitious long-term goals, and insulation from the COVID-19 crisis and other macro challenges.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.