2

My app uses Cosmos DB to store data. I have a requirement to support full-text search, which Cosmos does not provide out of the box. One of the recommendations was to use Elasticsearch, and I have been trying that out. The more I try it out, the more I feel like I am duplicating data. I literally push the same documents to Cosmos DB and Elasticsearch.

Am I heading down a bad path here? The way I see it, I should do one of these things:

  • use only Cosmos DB, simulating full-text by tokenizing+stemming content myself
  • use only Elasticsearch
  • use Cosmos DB in conjunction with Azure Search, which feels to me like it's not doubling-up on database responsibilities

Does anyone have any thoughts on my direction here?

  • seems like Azure search is the 'in stack' solution. I would try that first – Ewan Jan 29 at 9:03
4

Since I don't know everything about your usage, I cannot say what is the correct way for you.
What I can tell you is that mixing elastic with another DB is a legitimate and common course of action.

You can use elasticsearch as your main (or only) storage if you'll invest the time needed. You can also only index your requested fields in elasticsearch (without storing them), and sending a search request to elastic and using the returning ids to query your main storage to get more information of the selected items.

  • Interesting point about only indexing without storing. It hadn't even clicked that this was an option, since the API doesn't really lead you down that path. ie. it has you create a document which can be stored/indexed and re-hydrated in full. – me-- Jan 30 at 1:05

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.