1
votes

I have a web application (ASP.NET, C#) with a database on MongoDB Cloud Atlas.

I would like to experiment with the search service Azure Cognitive Search.

Does know if it is possible to connect the MongoDB Cloud Atlas to Azure Cognitive Search?

I have found an option to Copy data from MongoDB to Azure using Azure Data Factory but I would like to prevent storing data in 2 different places. (MongoDB cluster and Azure blob storage).

2
As of today Azure Search does not connect with a data source outside Azure, you will have to send the JSON document directly to Azure Search so it will then index it. But then this way any changes to any documents will have to be sent into the Azure Search as well. You can use Azure Cosmos DB's Mongo DB API and migration from Mongo to Cosmos is straightforward with no code change other than connection string change. BTW Cosmos DB is 100% cheaper than Mongo Atlas.Hassan Raza
@HassanRaza, thank you for comment and your suggestion. We actually just migrated from Cosmos DB to MongoDB last year because of performance issues and missing functionality in Cosmos DB (lower MongoDB version support). We indeed noticed that the migration was pretty straightforword. It's good to known that the way back is also straightforward.DutchFrank
way back, if only all the things you have implemented in Mongo Atlas are available in Azure Cosmos DB's Mongo API (terrible name). Though I am interested in what perf issues you faced with Cosmos. Storage cost would not be very high but Data Factory cost would be but still ADF is not very expensive.Hassan Raza
Have you considered MongoDB Atlas Search? It offers many of the same features that Azure Cognitive Search offers. mongodb.com/atlas/searchDoug
@Doug we looked at using Atlas Search and didn't think it would fit, but after your comment I revisited the site and did some deeper research and it seems that all are needed search capabilities should be possible. We're going go for Atlas Search (since we already have it). Thnx for your thoughtsDutchFrank

2 Answers

1
votes

If you are asking about a MongoDB Connector, then it's not available. You should code the logic to extract data from Mongo DB Atlas and send it to Azure Cognitive Search Service.

0
votes

The above answer is indeed correct. Here's one more option if you want to leverage some of the connectors we do have.

Azure CosmosDB offers a migration tool that will allow you to import data from a MongoDB into a CosmosDB collection of your choice. This data is accessible via the MongoDB API offered by CosmosDb (which means in theory any other application you own that needs to access this data can be reworked to reach into CosmosDB with minimal overhead).

If this is a feasible option, Azure Cognitive search indexers can then connect to the Azure CosmosDB via the MongoDB API - documentation here

This is a feature currently in gated preview, and if this interests you we highly recommend you sign up here: https://aka.ms/azure-cognitive-search/indexer-preview.

I know this solution also needs you to port over your data from Atlas into Azure, but do give it a try if it's not too much overhead. (and this will save you time to manually extract data from MongoDB into your search index via the push API)