Datadog (DDOG -10.37%) has generated massive gains since its initial public offering in September 2019. The cloud-based software company went public at $27, started trading at $40.50, and now trades above $160 per share.

That rally boosted Datadog's market capitalization from $11 billion on its first trading day to just over $50 billion as of this writing. That's a promising start, but could Datadog's valuation possibly rise another 20 times to more than $1 trillion within the next two decades?

An IT professional checks a server.

Image source: Getty Images.

Why did Datadog dazzle the investors?

Datadog's cloud-based platform monitors the performance of an organization's servers, databases, cloud services, and apps in real-time. It then organizes all of that data onto unified dashboards for IT professionals. This streamlined system breaks down "data silos" and makes it much easier for IT professionals to spot and diagnose potential problems.

Datadog was founded 12 years ago, and its growth in large customers and revenue since its public debut has been very impressive:

Period

FY 2019

FY 2020*

FY 2021

Customers with an ARR above $100,000

858

1,228

2,010

Growth (YOY)

89%

46%

63%

Customers with an ARR above $1 million

50

101

216

Growth (YOY)

72%

94%

114%

Total revenue

$362.8 million

$603.5 million

$1.0 billion

Growth (YOY)

83%

66%

70%

Data source: Datadog. ARR = annual recurring revenue. YOY = year over year. *Customer account readjusted in 2021 to reflect acquisitions.

Datadog has also kept its dollar-based net retention rate, which gauges its average year-over-year revenue growth per customer, above 130% for 18 consecutive quarters. Its customers are also using more of its products each year, which indicates its "land and expand" strategy is working:

Percent of Customers Using:

FY 2019

FY 2020

FY 2021

2 or more products

58%

72%

78%

4 or more products

10%

22%

33%

Data source: Datadog.

But can Datadog maintain that momentum?

The company's growth has been spectacular, and investors are still willing to pay a premium for the stock at 33 times this year's sales. But will that last over the following two decades?

Here's what we know so far. Datadog expects its revenue to grow 47% to 49% in 2022, while analysts anticipate 49% growth in 2022 and 37% growth in 2023. Those estimates don't factor in any potential acquisitions.

Meanwhile, the global cloud analytics market could expand at a compound annual growth rate (CAGR) of 20.7% between 2021 and 2028. Datadog's net retention rate suggests it can grow at a much faster clip than the broader market, even if its growth in customers gradually cools off.

If Datadog can grow its revenue at a CAGR of 25% between 2021 and 2028, its annual revenue could jump from $1 billion to over $5 billion. If its revenue continues to rise at a more moderate CAGR of 20% from 2028 to 2040, it could potentially generate $45 billion in revenue in the final year.

Let's say Datadog still trades at 30 times sales by then, the company could be worth $1.4 trillion by 2040. However, that's not a terribly realistic price-to-sales ratio for a company that generates about 20% revenue growth per year.

For reference, Salesforce.com (CRM 1.02%), which believes it can grow its annual revenue at a CAGR of 19% between fiscal 2021 to 2026 to $50 billion, currently trades at just six times its fiscal 2023 sales. Twilio (TWLO 0.37%), which aims to generate at least 30% organic revenue growth annually for the "next several years," trades at eight times this year's sales.

Therefore, a more realistic market cap for Datadog by 2040 would be about $450 billion, based on $45 billion in annual sales and a price-to-sales ratio of 10. That would still be a nine-bagger gain from its current levels -- but its cooling valuations will likely prevent it from joining the 12-zero club.

Look beyond Datadog's market cap

Datadog might become a cloud software giant over the next twenty years, but it still faces plenty of unpredictable challenges. It could face fresh competition, lose its momentum, or get gobbled up by a much larger company.

So instead of focusing on its potential to become a trillion-dollar company, investors should focus on its ability to maintain stable growth margins, expand its operating margins, and stay profitable on the basis of generally accepted accounting principles (GAAP). They should also see if it can maintain its high net retention rate while gaining more customers.

If Datadog can continue to impress investors with those metrics, as it did over the past three years, then its stock will continue to generate big long-term gains. It just probably won't be a trillion-dollar company by 2040.