Shares of Alibaba (NYSE:BABA), the largest e-commerce company in China, more than doubled over the past 12 months. The stock's rally was sparked by a streak of accelerating sales growth and improving profitability, fueled by the expansion of its e-commerce and cloud service ecosystems.

Alibaba remains a solid investment in the rising spending power of China's middle class, which became the world's largest middle class in 2015, and the country's growing internet penetration rate, which only recently exceeded 50%. That's why analysts expect Alibaba's revenue and earnings to respectively rise 55% and 44% this year.

Alibaba's campus in Hangzhou, China.

Image source: Alibaba Group.

That being said, Alibaba isn't invincible -- and it faces daunting competitive threats on multiple fronts. The top three challengers investors should look out for are JD.com (NASDAQ:JD), Tencent (NASDAQOTH:TCEHY), and Baidu (NASDAQ:BIDU).

JD.com

Investors sometimes dismiss JD.com, the second largest e-commerce company in China, as a second-rate Alibaba. Yet JD.com actually narrowed its market share gap with Alibaba's Tmall over the past few years.

Back in 2014, Tmall and JD.com respectively controlled 54.6% and 17.7% of China's e-commerce market according to Analysys International Enfodesk. But by the second quarter of 2017 Tmall's share had slipped to 51.3%, while JD.com's share had jumped to 32.9%.

JD.com gained ground against Tmall as other smaller B2C (business-to-consumer) marketplaces failed. As more affluent Chinese customers started prioritizing authenticity over low prices, JD's "zero tolerance" policy for fake goods made it a more desirable platform than Alibaba's Taobao C2C (customer-to-customer) platform.

Looking ahead, JD.com is countering Alibaba on multiple fronts, including new logistics networks and solutions, overseas expansions, and a dedicated platform for luxury goods.

Tencent

JD.com's biggest investor is Tencent, China's biggest social networking company and the top video game publisher in the world. Tencent initially acquired 15% of JD.com in 2014, then boosted its stake above 20% in 2016.

Tencent's WeChat, the most popular messaging app in China, has 980 million monthly active users (MAUs) worldwide. Its older QQ messaging app reaches 653 million MAUs, while its social network Qzone has 568 million MAUs. Its gaming portfolio includes blockbuster games like Honor of Kings, League of Legends, and Clash of Clans.

WeChat's iOS app.

WeChat's iOS app. Image source: iTunes.

Yet Tencent doesn't have much of a presence in the e-commerce market. That's why it gradually expanded WeChat into a multi-function platform for deliveries, online purchases, mobile payments, and other services.

To expand that ecosystem, it invested in JD.com, co-invested in third-place e-commerce player Vipshop (NYSE:VIPS) with JD.com, and struck e-commerce partnerships with brick-and-mortar retail giants like Wal-Mart (NYSE:WMT) (which also owns a major stake in JD.com) and Carrefour.

These companies are all sharing their shopper data and offering cross-platform purchases, which could wound Alibaba with a thousand cuts.

Baidu

Another one of JD.com's major partners is Baidu, which controls about 70% of China's online search market. Like Tencent, Baidu doesn't have a meaningful e-commerce presence of its own.

But last August Baidu integrated JD.com's e-commerce features into its ecosystem, enabling its users to directly purchase JD.com goods from within its apps. The two companies also pooled their user data, which leverages Baidu's AI tech to analyze shopper purchases on JD.com, while using JD.com's data to craft better targeted ads on Baidu.

Baidu's mobile app.

Baidu's mobile app. Image source: iTunes.

Baidu's deal with JD.com is a direct threat to Alibaba, but Baidu also indirectly threatens Alibaba with competitive distractions. As Alibaba expands its ecosystem beyond e-commerce, it's investing a lot of money in certain markets -- like online video and search -- which are dominated by Baidu.

Baidu's iQiyi and Tencent Video are the most popular online video platforms in China, according to QuestMobile and Jefferies, but Alibaba's Youku Tudou trails in third place. Alibaba also purchased mobile browser and search engine provider UCWeb in 2014 to challenge Baidu, but UCWeb's Shenma search engine only controls about 15% of the market.

As Alibaba pours more money into these lackluster ecosystem-building efforts, it could lose its focus as its operating expenses surge.

The bottom line

Alibaba is still one of China's great growth stocks, but investors should be wary of the threats it faces. On their own, JD.com, Tencent, and Baidu probably couldn't topple Alibaba. But by pooling together their resources and enlisting the help of brick-and-mortar giants like Wal-Mart and Carrefour, these companies become a bundle of sticks which are much tougher to break than a single one.

Leo Sun owns shares of Baidu, JD.com, and Tencent Holdings. The Motley Fool owns shares of and recommends Baidu, JD.com, and Tencent Holdings. The Motley Fool has a disclosure policy.