2020 has been a tale of two markets, and the Nasdaq Composite (^IXIC -0.81%) has definitely been the big winner. Even as old-economy stocks have suffered dramatic declines due to the COVID-19 pandemic, many of the tech-focused companies whose shares trade on the Nasdaq stock market have been able to adjust to the need for remote computing capabilities. Both the Composite index and the Nasdaq 100 Index reached new highs, climbing around 0.5% and 1%, respectively, even as other market benchmarks fell.

Even away from tech, Nasdaq stocks have done well, and Costco Wholesale (COST -0.15%) helped power the index higher Thursday. Meanwhile, Amazon.com (AMZN -0.34%) raced to new record heights, and while some are concerned about the nearly uninterrupted ascent for the tech giant, there are solid reasons why Amazon is doing as well as it is.

Exterior of a Costco store whose sign reads Costco Wholesale.

Image source: Costco Wholesale.

There's no slowing down Costco

Costco saw its stock rise more than 3% on Thursday. Investors were pleased to see the warehouse retailer post a strong showing in June, as it signaled a potential rebound from coronavirus-caused weakness in past months.

Costco reported that same-store sales across the entire company rose 11.5% in June. When you take out the impact of changes in gasoline prices and foreign exchange rates, sales looked even better, rising 14.4%. International markets other than Canada were the best performers, but the U.S. also put in good results.

E-commerce was a huge bright spot for Costco. Sales from the e-commerce channel jumped 86% from year-ago levels. Customers have flocked to online ordering as a result of the pandemic.

Costco reported more shoppers visiting its U.S. stores in June as well, reflecting the fact that many areas are reopening from shutdowns. Whether that continues depends on how the COVID-19 outbreak progresses, but investors are optimistic that Costco will weather the crisis no matter how long it takes.

Amazing Amazon

Amazon.com's stock posted similar gains, rising just under 2%. With its much higher market capitalization, though, Amazon is getting close to the $1.6 trillion mark. That's one sign of just how impressive the e-commerce and cloud computing company's ascent has been lately.

Amazon had a small piece of good news, as it settled a dispute with the Treasury Department's Office of Foreign Assets Control. OFAC is responsible for sanctions against certain foreign countries, and Amazon had apparently violated those sanctions by engaging in several hundred transactions with people in countries like Iran and Syria. However, the settlement cost Amazon just $134,523, as OFAC determined that the violations weren't egregious, and Amazon had voluntarily reported the transactions.

But what's likely propelling Amazon higher today is simply the recognition that the tech giant is doing things well. On the e-commerce side of the business, Amazon's marketplace is fending off competition, even as Walmart (WMT -0.10%) seeks to ramp up its own Walmart+ subscription service to go up against Amazon Prime. Moreover, with so many businesses trying to ramp up their cloud computing presence, Amazon Web Services is also doing well.

It's always been hard to use traditional valuation metrics on Amazon. Bullish investors still think there's more upside for the FAANG stock, however, and further growth in its business could help send both its stock and the Nasdaq to new record highs.