Shares of MongoDB were down as much as 15 percent and closed 13 percent lower Thursday after Amazon introduced cloud-based database software that represents direct competition.

In its quest to grow larger, parts of Amazon — currently the world's most valuable public company — have at times ended up competing with certain business partners. That has happened before in the market-leading Amazon Web Services business, and that pattern is continuing.

"Amazon DocumentDB is designed from the ground up to give customers the performance, scalability and availability they need when operating mission-critical MongoDB workloads at scale," AWS said in a statement. AWS said it's using an older version of the MongoDB open-source technology.

MongoDB stock fell almost 5 percent in extended trading on Wednesday following the announcement.

"We remain bullish on the prospects for MDB to sustain high growth," KeyBanc Capital Markets analysts Brent Bracelin and Clarke Jeffries wrote in a note distributed to clients later on Wednesday. They said the cloud database market can handle multiple competitors and that MongoDB has "differentiated functionality" available in its newer software.

Cloud deployments are a growing part of MongoDB's business. The company offers a cloud-based version of its own database software atop the AWS computing and storage infrastructure, as well as on other clouds, including Microsoft Azure. AWS salespeople have been able to co-sell MongoDB's software running on AWS.

"Imitation is the sincerest form of flattery, so it's not surprising that Amazon would try to capitalize on the popularity and momentum of MongoDB. However, developers are savvy enough to distinguish between the real thing and a poor imitation," Dev Ittycheria, MongoDB's CEO, said in a statement provided to CNBC.

Some software companies that work with open-source software have sought to limit what other businesses can do with their software as the cloud providers continue their expansions. MongoDB adopted a new software license in October.

MongoDB's stock has risen 200 percent in the past year. "It's hard to conclude that this development doesn't have negative competitive implications, at least from a headline risk standpoint, specifically given the stock's lofty multiple," BTIG Research analysts led by Edward Parker wrote in a note distributed to clients on Thursday.

WATCH: Cloud plays may be 'best tech stocks to own' as 2018 ends: Cramer