Stock market losses in 2022 have slowed the shares of many companies. Amazon (AMZN 0.35%), for instance, has seen its stock drop 50% over the past year. Despite macroeconomic headwinds however, Amazon has seen continued growth in its e-commerce business during the past year. Amazon Web Services (AWS) is one of the most compelling reasons to invest in Amazon. Its rapidly growing cloud computing business is one of the top reasons to do so. With a market share of 34%, the platform is expected to grow at a compound annual rate (CAGR), 15.7% through 2030. Amazon's cloud computing role is paying off. AWS provided 100% of the company’s operating income in the third quarter 2022. Amazon has been protected by cloud computing in difficult economic years and it is expected to continue to grow in 2023. Investors have been disappointed by Amazon's ecommerce business over the past year. Unfair revenue comparisons to 2021 have impacted earnings reports. Amazon saw record sales due to the pandemic lockdowns that occurred in 2021 as more homebound customers flocked to its website for their necessities. Amazon's online store revenue increased 7% year-over-year to $53.5 billion in Q3 2022. This excludes fluctuations in foreign currencies. Third-party seller revenue grew 18% to $28.7 Billion as more merchants used Amazon's marketplace to sell products. Amazon Prime membership is the best part of its e-commerce business. It earned $8.9 million in revenue last quarter. Amazon U.S. Prime memberships reached 157.4 Million in 2022. This is approximately 59.8%. Although e-commerce was potentially at risk in 2022, economic headwinds will not last. According to the Federal Reserve, consumer spending has increased over the past three quarters. It might seem like Amazon isn't in the running with digital advertising giants such as Meta and Alphabet. The company has made substantial progress in this market over the past few years. Amazon's digital advertising market share increased from 7.8% in 2019 to 13.3% in 2022. It is expected to increase to 14.6% by 2023. GlobeNewswire predicts that the global digital advertising market will grow at 13.9% annually to $786.2 billion in 2026. Amazon has experienced a difficult 12 months. But economic downturns won't last forever. The company's position in lucrative markets has increased in 2022 despite market difficulties, which proves it is a worthwhile long-term investment. It also makes a great buy before 2023. John Mackey is the CEO of Whole Foods Market (Amazon subsidiary). He is also a member The Motley Fool's Board of Directors. Randi Zuckerberg is a former director for market development and spokeswoman at Facebook. She is also the sister of Meta Platforms CEO Mark Zuckerberg. The Motley Fool's board includes Suzanne Frey, an Alphabet executive. Dani Cook does not hold any stock mentioned. The Motley Fool recommends Alphabet and Amazon.com and has positions in them. The disclosure policy of the Motley Fool is available.