It's been a tough year for the stock market as the spread of the coronavirus has created a pandemic around the world. That's been enough to send the S&P 500 (^GSPC 1.02%) down more than 25% so far in 2020, and many fear that even bigger declines could come soon.

However, some stocks have been able to keep climbing despite the downward pressure on the overall market. Although many of the companies that have gained ground in 2020 are in the pharmaceutical and biotech industries and are linked to efforts to come up with treatments or vaccines for the COVID-19 disease, some other companies with businesses largely unrelated to the coronavirus are defying also the downturn. Below we'll look at all three to see how they've gotten the job done.

AKAM Chart

AKAM data by YCharts. As of market close March 18.

Akamai

Akamai Technologies (AKAM -0.11%) has done a good job of capitalizing on the rising demand for content delivered via the internet as quickly and efficiently as possible. Steady growth in overall bandwidth capacity has given Akamai more growth opportunities over the years, and in particular the recent introduction of new video streaming services from several providers has been a huge potential source of business for the company.

With the COVID-19 pandemic leading to increased calls for people to stay home, the demand for entertainment is likely to rise in the weeks and months to come. That's good news for Akamai, especially as it provides the infrastructure that will allow competing video streaming services to fight against each other to build up their customer bases.

Digital Realty Trust

The real estate market has gotten hit hard by the coronavirus. The poor timing of the outbreak will have a huge impact on the spring homebuying season, and commercial real estate is suffering from retailers closing their doors and small businesses looking at threats to their survival. Yet one real estate investment trust, Digital Realty Trust (DLR 0.95%), has managed to outsmart the virus and keep producing good returns.

Digital Realty Trust owns data center locations that companies use for storing information. The rise of cloud computing has put data centers in high demand, and with many major enterprise customers having committed to keeping data in the cloud, it's unlikely that Digital Realty Trust will see many of its clients stop leasing information storage space in its data center properties. With more than 2,000 customers for its nearly 270 data centers, Digital Realty Trust is a leader in the field and pays a healthy dividend to boot.

Entrance to Smucker's store and cafe.

Image source: J.M. Smucker.

J.M. Smucker

Companies that sell essential consumer staples have traditionally been able to avoid big downturns when the broader economy comes under pressure, and the peanut butter and jelly that J.M. Smucker (SJM -1.37%) sells are some of the most popular staple food items in U.S. households. Other baking products have also been big purchases lately, as households prepare for a potentially long period of staying home.

Smucker has also sought to expand its product lineup in recent years, moving aggressively into the pet food segment at a time when Americans are showing more willingness to pay up to pamper their pets. That move hasn't been as successful lately as many had hoped, but with the company responding by cutting costs while looking at further strategic moves, Smucker is seeking to move forward even in a difficult time.

Staying healthy in a sick market

The coronavirus has created big problems for many businesses, but Akamai Technologies, Digital Realty Trust, and Smucker have found ways to prosper. Smart investors will want to keep watching these three stocks to see if they can build on their success so far in 2020.