Search code examples
c#azureazure-cosmosdbazure-cognitive-search

Benefits of using Document DB after connecting with Azure Search


I'm storing the data for my in Azure Document DB. In order to allow search over the description field of my data, I've connected my document DB repository with Azure Search, as explained here: https://learn.microsoft.com/en-us/azure/documentdb/documentdb-search-indexer

I also need to filter the results of the search via several parameters. I find myself adding more an more fields to my Azure Search indexers, up to the point where I'm almost duplicating my database entities to the Azure search entities.

The question - If I need to search over my data and decide to use Azure search, is there any benefit to keeping the data in Document DB, or will it be better to model it again using only Azure Search?


Solution

  • Document DB provides consistency guarantees that Azure Search does not. In general we don't recommend using Azure Search as a primary store. See my answer to this other SO question for specific caveats: Can Azure Search be used as a primary database for some data?