Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are some use cases for using Elasticsearch versus standard sql queries? [closed]

I'm just getting started with Elasticsearch and one of the main use cases I've seen is its scalability with searches on large data sets, but besides this when would you want to use it over just creating sql queries with a traditional RDBMS?

like image 288
James Drinkard Avatar asked Sep 29 '22 05:09

James Drinkard


People also ask

Why use Elasticsearch instead of SQL?

You want Elasticsearch when you're doing a lot of text search, where traditional RDBMS databases are not performing really well (poor configuration, acts as a black-box, poor performance). Elasticsearch is highly customizable, extendable through plugins. You can build robust search without much knowledge quite fast.

What is the use case of Elasticsearch?

Elasticsearch allows you to store, search, and analyze huge volumes of data quickly and in near real-time and give back answers in milliseconds. It's able to achieve fast search responses because instead of searching the text directly, it searches an index.


1 Answers

There are two primary Elasticsearch use cases:

  1. Text search

You want Elasticsearch when you're doing a lot of text search, where traditional RDBMS databases are not performing really well (poor configuration, acts as a black-box, poor performance). Elasticsearch is highly customizable, extendable through plugins. You can build robust search without much knowledge quite fast.

  1. Logging and analysis

Another edge case is that a lot people use Elasticsearch to store logs from various sources (to centralize them), so they can analyze them and make sense out of it. In this case, Kibana becomes handy. It lets you connect to Elasticsearch cluster and create visualisations straight away. For instance, Loggly is built using Elasticsearch and Kibana.

Keep in mind, that you wouldn't want to use Elasticsearch as your primary data storage. Reasons here: How reliable is ElasticSearch as a primary datastore against factors like write loss, data availability

Update

I felt like the second part is no longer edgy, it's actually what Elastic as a company has been doing really well in past year. With current DevOps movement, CI/CD pipelines, increasing amount of metrics from various sources, ELK became a defacto choice for infrastructure monitoring, it's no longer just a distributed RESTful text-search engine. It has an amazing set of products:

  • Logstash (tons of data inputs)
  • Beats
    • Filebeat
    • Metricbeat
    • Packetbeat
    • Winlogbeat
  • Kibana
    • Graph
    • Timelion
  • X-Pack (premium)
    • Alerts
    • Reporting
    • Security
    • Machine Learning
    • Cross data center metrics

An ecosystem, built by community, is growing around ELK stack that expands current features, few of them worth mentioning:

  • ElastAlert
  • Search Guard
like image 92
Evaldas Buinauskas Avatar answered Oct 13 '22 02:10

Evaldas Buinauskas