Elasticsearch

Elasticsearch is the name of a full-text search engine in computer science, distributed for free under the Apache license. It has a RESTful interface and offers high availability, speed, and scalability. It is developed in Java and can be communicated with via the web interface.

Elasticsearch is a schematic database, therefore it is not necessary to define the database structure because it is created based on embedded data. It can be included on the list of NoSQL databases.

Communication over HTTP – for example, deletion is performed by the HTTP method DELETE. Requests and replies are in JSON format. This allows Elasticsearch to be used by any programming language.

Although Elasticsearch requires installation of a Java Runtime Environment.

Key properties:

  • Real-time data
    • The main feature of Elasticsearch is its speed from which, for example, benefits filter on web pages to display results almost instantly.
  • Distributed system
    • Elasticsearch can be easily scaled when the load on the server in which it runs increases. If server performance is low, just add another server. The cluster then optimally splits the data between the nodes.
  • High availability
    • If one of the nodes of the cluster fails, Elasticsearch detects it and disables the particular node. The data is then distributed among the rest of the nodes to ensure the highest availability. Moreover, the data remains secure.
  • Fulltext search
    • Elasticsearch uses Apache Lucene, which is probably the most powerful full-text search available in the open-source software:
      • supports multiple languages
      • geographical search
      • a search of similar or related records
    • It can also be used to intelligently prefill forms on the web.
  • RESTful API
    • Elastic uses API – nearly every action can be performed using a JSON document that is sent over HTTP. Some libraries simplify the use of Elasticsearch for many programming languages.
ElasticsearchRelational databases
IndexDatabase
Type (type)Table
Document (document)Record (table row)
Field (field)Attribute (table column)

A Document is a text file that contains searched information. In the case of Elasticsearch, it is specifically a JSON file.

The document is a table of different data types. In the case of Elasticsearch it is not required to define them in advance. Elasticsearch is created by default, based on the document structure.

Documents are stored in an index, similar to a database schema as in a relational database. At its level, it is possible to set storage parameters common to the whole set of documents.

The original autor: Filip, Junior DevOps Engineer, cloudinfrastack