Software Developer ·
Needs advice
on
ElasticsearchElasticsearch
and
MongoDB AtlasMongoDB Atlas

Confused to implement a full-text search feature for a web application. Right now we are storing all the data's in MongoDB Atlas. I know MongoDB Atlas is providing a full-text feature, but it is so limited. Our users should have the ability to search from more than 15 collections. How should I implement this in MongoDB Atlas?. While searching I found Elasticsearch cloud provides a full-text search feature. Should I move our application data from MongoDB Atlas to elastic cloud only for search?.

READ LESS
13 upvotes·12.8K views
Replies (1)
Software Engineer at Blend Labs·

Hey Balaji, What is your use case here? What will be the number of requests you will receive? I have been using Elasticsearch for some time now and don't know much about Atlas. Built on top of Lucene, Elasticsearch is designed for searching, however it can get complex to maintain in production, particularly as data grows. ES offers tons of options for full text searches, for example, ES analyzer makes it easier to write very specific queries that can pull back filtered results immediately. ES is free and open source, so if you run into any difficulties, you will have no problem finding solutions unless you are doing something very niche.

READ MORE
analyzer | Elasticsearch Guide [7.15] | Elastic (elastic.co)
4 upvotes·4 comments·4.8K views
shashank agarwal
shashank agarwal
·
October 6th 2021 at 3:11PM

Hi Balaji, I had a similar problem while designing a content app that pulled in thousands of articles each day. However, my backend was Dynamodb which is even more limited than mongoDB. I considered using Algolia for the search but that proved to be a bit expensive so finally decided to use Elasticseach but just for the search, my database was still dynamodb (MongoDB in your case).

I would send all updates/deletes etc from dynamodb to elasticsearch via ddb streams and used elasticseach as the default search for the application and also for any kind of read operations. I would not recommend using Elasticsearch as a database as it is not meant to be used as a database for various reasons. The dual approach with MongoDB/DynamoDB as the database(source of truth) and ElasticSearch as the search/read worked very well for me.

·
Reply
Balaji v
Balaji v
·
February 8th 2022 at 12:50PM

Thank you so much.

Your explanation with Dynamodb and Elasticsearch was so helpful.

·
Reply
Amit Tiwary
Amit Tiwary
·
October 6th 2021 at 4:28PM

Hi Balaji, developers use a combination of elasticsearch and a database like MySQL or MongoDB for such a scenario. So you can save the text, on which you want to add search, in elastic search with an id. This id will be linked to a collection or doc id in MongoDB. When the user searches a string, you will get the corresponding id from elasticsearch and then find the correct collection or doc id in MongoDB.

·
Reply
Balaji v
Balaji v
·
February 8th 2022 at 12:53PM

Thanks

·
Reply
Avatar of Balaji v

Balaji v

Software Developer