Alibaba (NYSE: BABA) and Facebook (NASDAQ: FB) are two of the world's top tech companies. Alibaba is China's largest e-commerce and cloud company, and Facebook owns the world's largest social network. Alibaba's stock more than tripled since its IPO in 2014, while Facebook's stock rose more than sixfold since its IPO in 2012. Both stocks are still solid long-term investments, but which one is the better buy today? Image source: Getty Images. How do Alibaba and Facebook make money? Alibaba generated 82% of its revenue from its core commerce business last quarter, which includes Taobao and Tmall in China, Lazada in Southeast Asia, AliExpress for overseas shoppers, Alibaba.com for businesses, its cross-border marketplaces, and brick-and-mortar stores. Its Chinese marketplaces serve 726 million annual active customers. Alibaba's cloud business generated 11% of its revenue, while the rest came from its digital media and innovation initiatives businesses, which house other products and services -- including its streaming media platforms, web browser, search engine, and smart speakers. Image source: Getty Images. However, only the core commerce business is profitable, and Alibaba subsidizes the growth of its unprofitable businesses with its online marketplaces. Those marketplaces, which sell paid listings to merchants, also make it China's largest digital advertising platform. Facebook's core platform serves 2.6 billion monthly active users. Its entire family of apps -- which includes Messenger, WhatsApp, and Instagram -- reaches nearly 3 billion people every month. It also sells Oculus VR headsets and Portal smart screens. Facebook generated 98% of its revenue from online ads last quarter. The remaining sliver mainly came from its hardware devices. Facebook and Alphabet's (NASDAQ: GOOG) (NASDAQ: GOOGL) Google share a near-duopoly in online ads in many countries, but both companies face fresh competition from Amazon.com (NASDAQ: AMZN), which is leveraging its e-commerce dominance to sell more ads across its platforms. Facebook's main platforms are blocked in China, but it still generates a significant amount of revenue from Chinese companies -- which are buying ads aimed at overseas customers. How fast are Alibaba and Facebook growing? Alibaba's revenue rose 35% in fiscal 2020, which ended on March 31, as its adjusted earnings per share (EPS) grew 38%. It expects its revenue to rise at least 28% in fiscal 2021, even after factoring in COVID-19 headwinds, and analysts expect its adjusted earnings to grow 14%. Those are solid growth rates for a stock that trades at 26 times forward earnings. But Alibaba faces several persistent headwinds. Its core commerce business is growing increasingly dependent on its lower-margin brick-and-mortar and cross-border marketplaces for fresh growth. Its online marketplaces also face tough competition from JD.com and Pinduoduo, the second- and third-largest e-commerce players in China, respectively. It's also butting heads with Tencent (OTC: TCEHY) in China's cloud market, where Tencent ranks second, and online payments, where Alibaba's affiliate Alipay shares a near-duopoly with Tencent's WeChat Pay. That competition could throttle Alibaba's revenue growth and compress its margins. There's also a small (but noteworthy) chance U.S. regulators could force U.S.-listed Chinese companies like Alibaba to delist their shares. Facebook's revenue rose 27% in 2019, but its EPS declined 15% on higher ecosystem investments and expenses incurred from regulatory probes regarding its privacy and security practices. Facebook hasn't provided any guidance for 2020 -- but analysts expect its revenue and earnings to grow 10% and 13%, respectively, as the COVID-19 crisis throttles ad purchases. Those growth rates are a bit tepid for a stock that trades at over 30 times forward earnings. Facebook's core platforms are still growing, but Gen Z-oriented platforms like Snap's Snapchat and ByteDance's TikTok are luring away younger users. Google, Amazon, and other rivals could attract its advertisers, and it still faces unresolved antitrust issues in both the U.S. and overseas markets. The winner: Alibaba Facebook and Alibaba will both keep dominating their respective markets, and both tech stocks could climb higher over the next decade. However, Alibaba's better-diversified business, stronger growth rates, and lower valuation make it a stronger overall investment. Facebook needs to diversify its core business beyond ads, overcome its privacy and antitrust issues, and stabilize its decelerating growth before it's considered a sound investment again. 10 stocks we like better than FacebookWhen investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.* David and Tom just revealed what they believe are the ten best stocks for investors to buy right now... and Facebook wasn't one of them! That's right -- they think these 10 stocks are even better buys. See the 10 stocks *Stock Advisor returns as of June 2, 2020 John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Randi Zuckerberg, a former director of market development and spokeswoman for Facebook and sister to its CEO, Mark Zuckerberg, is a member of The Motley Fool's board of directors. Leo Sun owns shares of Amazon, Facebook, JD.com, Snap Inc., and Tencent Holdings. The Motley Fool owns shares of and recommends Alibaba Group Holding Ltd., Alphabet (A shares), Alphabet (C shares), Amazon, Facebook, JD.com, and Tencent Holdings and recommends the following options: short January 2022 $1940 calls on Amazon and long January 2022 $1920 calls on Amazon. The Motley Fool has a disclosure policy.Source