Forum Discussion
CosmosDB Vs Azure AI Search
Dear All,
We are building a modern data platform based on Microsoft Fabric and Purview, designed to serve as a proper Data Marketplace capable of handling structured, semi-structured, and unstructured data.
The reason for this message concerns specifically the unstructured data workstream and how best to architect it end-to-end.
Context and current design
We do not yet have the full set of use cases needed to finalise the E2E design with confidence. However, we have already defined the ingestion and bronze layer architecture as follows:
- A third-party tool (selected by the business) extracts source files and converts each one into a JSON payload containing both the file metadata and its content.
- These payloads are published to Azure Service Bus.
- A triggered pipeline collects the payloads from the bus and lands them in our Landing Zone, which consists of a dedicated Fabric workspace containing a Lakehouse.
- The JSON files are stored immutably in the Lakehouse Files section.
- Using the same pipeline and trigger, a notebook processes each JSON file and splits it into two Delta tables in the Bronze layer — one for metadata, one for content.
We are comfortable with this design up to and including Bronze.
The open question — Silver onwards
This is where we need your input. Two proposals are on the table:
- Use a Cosmos DB (as a Fabric item) in a dedicated Gold workspace as a document serving layer.
- Introduce Azure AI Search, leveraging its built-in chunking and embedding capabilities to avoid having to implement those steps ourselves in Silver.
We see three possible architecture options :
- Option 1 — Cosmos DB only, serving both as document store and RAG backend. This would require us to implement chunking and embeddings ourselves (likely in Silver or during ingestion into Cosmos DB).
- Option 2 — Cosmos DB as document store + Azure AI Search for RAG and semantic search. In this case, chunking and embeddings would be handled by Azure AI Search, not by us.
- Option 3 — Azure AI Search only, handling document storage, chunking, embeddings, and RAG in a single service.
For options 2 and 3, we believe Azure AI Search's native indexing capabilities would eliminate the need for us to build chunking and embedding pipelines. For option 1, we would need to own that complexity ourselves.
Important constraints
- We do not require real-time processing. Near-real-time or batch is perfectly acceptable.
- Volume is modest — approximately 1,000 documents per day, possibly fewer.
- A key functional requirement that appears to be driving the Cosmos DB proposal is the need for certain users to visually compare the original physical document against its JSON representation, validate the output, and make corrections directly if needed. Cosmos DB is being considered as the interface for that editorial workflow. if i undertood it correbtly from what was told to me ...
Specific questions
- When do we actually need Cosmos DB ? Which use cases genuinely cannot be served by simply exposing the Silver Delta tables as a JSON document store which would be composed by two tables (metadata of the file plus content table, both linked via document_id)?
- If we use Cosmos DB and exclude Azure AI Services, should the chunks produced in Silver also be stored there? And where should embeddings be generated — in Silver, or natively within Cosmos DB during the write process?
- Would you recommend using both Cosmos DB and Azure AI Search together? If so, should they be connected to each other, or should Azure AI Search index directly from Silver while Cosmos DB sits in Gold serving only the original documents (without chunks or embeddings)?
- Should end users be permitted to edit payloads directly in Cosmos DB, or should that interaction be governed and controlled somehow differently?
Any guidance on how to think through this architecture would be greatly appreciated.
Many thanks, Pedro
Hi fabricpribeiro ,
If the requirement includes allowing users to review the extracted JSON, compare it against the original document, and make corrections when discrepancies are identified, then introducing Cosmos DB could be beneficial. In that scenario, Cosmos DB can act as the operational document store that supports the validation and correction workflow, while keeping the original source data and any curated versions of the document.
If both Cosmos DB and Azure AI Search are used, I would recommend keeping their responsibilities separate. Cosmos DB can store and serve the document content and user corrections, while Azure AI Search handles the AI-specific capabilities such as chunking, embedding generation, vector indexing, semantic search, and RAG retrieval. This avoids having to implement and maintain those capabilities yourself and leverages Azure AI Search for what it is designed to do best.
In other words:
- Cosmos DB -> Document review, validation, correction, and operational access.
- Azure AI Search - >Chunking, embeddings, vector search, semantic search, and RAG.
This approach provides a clear separation of concerns and avoids storing and managing chunks and embeddings in multiple places unless there is a specific business requirement to do so.
Regarding your final question, If you choose to use Azure AI Search without Cosmos DB, third-party applications, chatbots, copilots, and other RAG systems can connect directly to Azure AI Search through its APIs and SDKs. You are not limited to the Azure AI Search UI.I hope this information helps. Please do let us know if you have any further queries.
Thank you
5 Replies
- v-nmadadi-msft
Community Support
Hi fabricpribeiro ,
Thanks for reaching out to the Microsoft Fabric Community forum.Based on the requirements you've described, I would also consider whether Cosmos DB is needed at all. Azure AI Search supports OneLake as a data source, allowing it to index content directly from your Fabric data estate. This means you can ingest the document content and metadata stored in your Lakehouse (Silver layer) directly into Azure AI Search and take advantage of its built-in capabilities for indexing, chunking, embedding generation, vector search, semantic ranking, and RAG scenarios.
With this approach, your architecture becomes simpler:
Landing - > Bronze - > Silver (Delta Tables / OneLake)
↓
Azure AI Search
↓
Search / RAG / Copilot
The main advantages are:
- No need to maintain a separate Cosmos DB document store.
- Reduced architectural complexity and cost.
- Azure AI Search handles chunking and embeddings natively, eliminating the need to build and maintain those pipelines yourself.
- Silver Delta tables remain the authoritative source, simplifying governance, lineage, and Purview integration.
Unless you have a strong requirement for an operational document database for example, frequent document updates, low-latency transactional access, or a dedicated document editing workflow Azure AI Search indexing directly from OneLake may be sufficient for your search and RAG requirements while keeping the overall solution much simpler.
I hope this information helps. Please do let us know if you have any further queries.
Thank you- fabricpribeiro
Post Patron
I see your reply. Makes sense to me. But:
1) They say they need to check what was generated by Json and if necessary make corrections
2) They need to compare the physical document with the Json (reconcile) and amend anthing in the Json which maybe incorrect
Would this be a driver for having the CosmosDB? for example to be able to change the Json it has incide in case the reconciliation states that Json (generated by the extraction tool) is not accurate?
Also interesting, in case both need to co-exist (cosmosdb and Azure AI Search) shall they have any connection ? or the cosmosDB should only have Json and not chunking nor embeddings as that work can be done by Azure AI? or would you recommnend , in case both are needed, that we pass everything to cosmosDB (chcunking and embeddings as well) and then ask Azure AI search to consume from there?
What do you mean with : "frequent document updates" in this case, it should be less than 1000 per day would that be a driver for cosmosDB adoption?
Last, but not less important, in case we do not implement cosmosDB and go instead only with Azure AI Search, can we allow people to connect there, including RAG systems like chatBots , other apps and consume from what was chunkd by the Azure AI Serach? or its not possible to ask 3 party apps / users to connect to it to extract information and you can only opperate azure AI search via its UI?
Thanks a lot,
Pedro
- v-nmadadi-msft
Community Support
Hi fabricpribeiro ,
If the requirement includes allowing users to review the extracted JSON, compare it against the original document, and make corrections when discrepancies are identified, then introducing Cosmos DB could be beneficial. In that scenario, Cosmos DB can act as the operational document store that supports the validation and correction workflow, while keeping the original source data and any curated versions of the document.
If both Cosmos DB and Azure AI Search are used, I would recommend keeping their responsibilities separate. Cosmos DB can store and serve the document content and user corrections, while Azure AI Search handles the AI-specific capabilities such as chunking, embedding generation, vector indexing, semantic search, and RAG retrieval. This avoids having to implement and maintain those capabilities yourself and leverages Azure AI Search for what it is designed to do best.
In other words:
- Cosmos DB -> Document review, validation, correction, and operational access.
- Azure AI Search - >Chunking, embeddings, vector search, semantic search, and RAG.
This approach provides a clear separation of concerns and avoids storing and managing chunks and embeddings in multiple places unless there is a specific business requirement to do so.
Regarding your final question, If you choose to use Azure AI Search without Cosmos DB, third-party applications, chatbots, copilots, and other RAG systems can connect directly to Azure AI Search through its APIs and SDKs. You are not limited to the Azure AI Search UI.I hope this information helps. Please do let us know if you have any further queries.
Thank you
- v-nmadadi-msft
Community Support
Hi fabricpribeiro
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you. - v-nmadadi-msft
Community Support
May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.
Thank you