How to implement Transport-Client for running a website which uses ElasticSearch as database?

93 views Asked by At

Goal: Create a website which uses ElasticSearch to deliver its content.

Problem: There will be many users concurrently accessing the website.

Options:

  1. Create and destroy a transport-client object for every request

  2. Create a pool of transport-client objects which will be reused

  3. Use a transport-client object as singleton

According to the docs here, a Node-Client is not an option for this scenario.

Technical background if it makes any difference: The website will be using Play Framework with Java. There will be a fancy JS frontend and it is expected that there will be many tiny AJAX HTTP requests harassing ElasticSearch.

1

There are 1 answers

4
dadoonet On BEST ANSWER

Use the Transport Client as a singleton.