When it comes to companies that provide web hosting services, Amazon's (AMZN -2.56%) AWS is among the best known and most established in the space. However, investors shouldn't ignore small-cap competitor DigitalOcean (DOCN -1.52%), which has found a niche to exploit and had a stock offering with an impressive debut on the public markets.

Between the two stocks, where should investors looking for the best buy put their investment dollars today?

Person typing on computer with graphics floating in air

Image source: Getty Images.

Size is an advantage for AWS

Jeff Santoro (Amazon): Amazon has come a long way from its humble beginnings as an online book retailer. One of the most impressive additions to the business is Amazon Web Services (AWS). AWS has grown to be the leader in the cloud infrastructure space, with a 32% market share. Within Amazon's overall business, AWS has also become its best-performing segment. In the most recently reported quarter, AWS saw year-over-year revenue growth of 39%. This easily outpaced the North America and International segments, which grew revenue 10% and 16% respectively. This pace of growth is often lost in the headline numbers of Amazon's overall business performance.

AWS' reputation as the leader in the space allows it to capture large, stable businesses as customers. In its Q3 earnings release, Amazon announced several well-known companies as customers, including Wyndham Hotels & Resorts, telecom provider Boingo Wireless, and Sun Life, a financial services company. These larger companies provide some long-term security to the AWS business, as they're less likely to go out of business or leave for another provider. Smaller competitors like DigitalOcean run the risk of having customers go out of business, or outgrow its offerings. Amazon's vast resources also allow it to expand its already long list of AWS offerings for customers. Specifically, management used the Q3 earnings call to call out its investments in machine learning as a reason for the strong AWS usage and revenue growth.

While AWS alone is a compelling reason to own Amazon, investors shouldn't forget that buying shares means owning the rest of the company as well. On a two-year basis -- which excludes some of the biggest pandemic effects -- third-quarter compounded revenue growth was 25% annually, a healthy increase for a company of Amazon's size. While the hyper-growth days of Amazon's e-commerce business may be behind them, so is the accompanying volatility. Amazon shareholders should get stable and reliable returns while reaping the rewards of the fast-growing AWS segment.

Targeting a lucrative niche

Jamie Louko (DigitalOcean): When it comes down to choosing which cloud services provider to invest in, I think that DigitalOcean is the clear winner. It focuses on a specific niche market, providing simple and transparent cloud offerings to small- and medium-sized businesses (SMBs). This has been an elusive target market for Amazon's AWS, but that is because AWS lacks some features that are really important to SMBs: simplicity, transparency, and a helpful community.

Unlike AWS, DigitalOcean not only has all of these features but thrives on them. DigitalOcean focuses on a small number of solutions for SMBs looking to create a cloud presence, focusing on the essentials that they need, like Droplets -- which are simple virtual servers -- and app platforms where SMBs can quickly develop, manage, and scale apps.

Its service also has transparent pricing -- something that AWS is desperately in need of -- along with a community filled with knowledge. DigitalOcean's community consists of cloud experts looking to help SMBs who might not know a whole lot about cloud development. These experts provide tutorials and answers to questions that DigitalOcean customers might have.

Even though AWS has an offering made specifically for SMBs, the company has failed to integrate advantages like these, which is why DigitalOcean has become the primary SMB cloud provider. The company has obtained almost 600,000 customers in 185 countries, which has resulted in impressive growth. The company saw 37% year-over-year revenue growth in its third quarter to $111 million.

DigitalOcean is a risky stock because it is a young business, but its age gives it appealing growth prospects. With a $1.75 trillion market cap, investors in Amazon would be lucky to get a double out of its stock over the next five years, while DigitalOcean has much more potential for outsized stock price growth. Its market cap is less than $8.5 billion, and the company sees a market opportunity of $116 billion by 2024. With just $400 million in trailing 12-month revenue, the company has plenty of growth left in its target market. 

With competitive advantages that Amazon has failed to replicate, DigitalOcean is rapidly becoming the main player in its niche. Even though its market seems small on the surface, its opportunity is much larger than meets the eye. While there are risks, the company is well-positioned to capitalize and potentially multi-bag over the next five years.

Better buy?

With comparable financial results, investors should consider their goals when deciding between these two companies. Amazon brings a scale and experience advantage, but also may be slower to adapt or prove enticing to smaller businesses. Investors also enjoy the successes of Amazon's bread-and-butter e-commerce business. DigitalOcean swims in different waters, but is rapidly becoming the big fish in that smaller pond. When it comes down to it, the better buy may depend on each investor's choice between more reliable -- if less exciting -- performance and higher-upside volatility.