fbpx

Elasticsearch 101

What is Elasticsearch?

Elasticsearch or "Search as a Service" is a tech stack that allows you to store data and search in near real-time. It is an open-source search and analytics engine written in Java. Elasticsearch is known for its speed and scalability. In addition, its distribution is document-oriented rather than table-oriented and comes with extensive REST APIs. Elasticsearch is the heart component of the Elastic Stack, which consists of Beats, Logstash, Elasticsearch, and Kibana.

Why Do We Use It?

The speed and scalability of Elasticsearch and its ability to index several types of content make it suitable for applications that rely on the website, and enterprise search, logging, and business analytics. There are many existing use cases for Elasticsearch. It has been used in Stack Overflow, Github, and Uber for application search. For business analytics, Elasticsearch has also been used in Tinder, LinkedIn, Netflix, 9gag, and Tokopedia.

Architecture

The architecture for Elasticsearch includes several components. Let’s go over some of them and their definitions.

As seen on the image above, there is a cluster and nodes. A cluster is a group of one or more nodes that are connected with store data, while a node is a single server or instance which is a part of a cluster.

A Document, the basic unit of data stored, is a JSON object that contains any data in Elasticsearch. Every document is grouped into an index, a virtual component that keeps track of where documents are stored.
If you couldn't find an index on a disk, it's because a shard is there. A shard is a small and scalable indexing unit. Copies of primary shards are called replicas and are used for fail-safe mechanisms and increase search capacity.

Available Frameworks or Libraries

Here are the frameworks or libraries: Spring-boot, Laravel (PHP Framework), Django (Phyton), ASP.net, Express (Node.js), ReactJs, AngularJs, VueJs, Bedrock.io, etc.

Elasticsearch is a real-time search engine with a highly scalable structure. It is also open-sourced and is compatible with almost every platform. In addition, it also supports many programming languages. These are the benefits of using Elasticsearch. However, in using Elasticearch, a split-brain problem in some cases occurs. It also only supports JSON to handle request and response data.

The Elastic Stack (ELK)

  • Elasticsearch :The heart component of the Elastic Stack is a set of tools for search, storage, analysis.

Download link: https://www.elastic.co/downloads/elasticsearch
Prerequisite: JDK 1.8.0_131
Setup & Run:
Setting: ..\elasticsearch-7.15.0\config\elasticsearch.yml

Running Service: ..\elasticsearch-7.15.0\bin\elasticsearch
Default endpoint: http://localhost:9200

  • Kibana : The Data visualization and management tool allow sending queries syntax using REST API.

Download link: https://www.elastic.co/downloads/kibana
Setup & Run:
Running service: ..\kibana-7.15.0-windows-x86_64\bin\kibana
Open a browser and go to http://localhost:5601/, then go to Management >> Dev Tool

  • Logstash: Data processing pipeline.
  • Beats: A collection of data shippers.

Summary

In summary, Elasticsearch is one of the technologies recommended for search and data analytics due to its architecture and components, making it fast and scalable. Most applications now rely heavily on search features and business analytics. That's why we need powerful search engines, and Elasticsearch is the answer.

Author: Kholishul Aziz, Analyst Programmer

Share

Get the latest news from us to your inbox

(Weekly newsletter)

Leave a comment



from Indonesia:
from Australia:
from New Zealand:
from Singapore:
Our social media
        
© Copyright 1991 - 2022 Mitrais