Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GraphQL vs Elasticsearch what should i use for fast searching performance that return with many different schema?

I am making a real-time search that will indicate the correct pattern from the search string. Then it will search with this pattern and return with the correct database schema dynamically. Example Like: Google Assistant

like image 791
Shapon Pal Avatar asked Nov 28 '22 04:11

Shapon Pal


1 Answers

You are comparing apple with orange if you are comparing GraphQL with ElasticSearch. They are totally different technologies.

GraphQL is the API layer technology which compare to REST. It mainly defines the request/response format and structure of your HTTP based API. It is not another NoSQL that help you to store and query data efficiently.

If you are using GraphQL , you still need to query the data by yourself , which the data may actually store and come from NoSQL , SQL DB , ElasticSearch or other web service or blablabla . GraphQL does not care about where you store the data ,the data can even store at multiple data sources. What he cares is that you tell him how to get the data.

Back to your case , you most probably can use ElasticSearch for storing and searching the data efficiently. And put GraphQL in front of ElasticSearch such that users/developers interact with the service through GraphQL API in order to enjoy GraphQL benefits.

like image 52
Ken Chan Avatar answered Jan 14 '23 03:01

Ken Chan