Compress Your Data Within Elasticsearch

Compressing is awesome, making something smaller than the original size sounds like magic but it is possible. We know it from our WinRar, 7Zip or other tools. Even Elasticsearch has a property to compress the data which will be tossed between the nodes and the clients, this could be very useful to reduce network latency when handling huge responses from Elasticsearch. Within this article we will cover the following topics:

  1. Enable HTTP/TCP compression
  2. Handling compressed responses
    • Elasticsearch 7.7 and below
    • Elasticsearch 7.8 and upwards
    • Future Elasticsearch release 7.9 and 8.0

Most of us are already familiar with Elasticsearch from Elastic when working with application logs, but a-lot of people never heard about. Below is a short summary:

Elastic Search @ 6.4.3

Elastic - 6.4.3

Working with Elastic is quite fun. You can simply use a query string URL or compose a Java program using the Java high-level/low-level client to consume and return the results.

In this blog, I am going to write a simple Java service that will expose a specific computation on top of an elastic search query. You can read more at the elastic.io