# ElasticSearch Java REST Client - Singleton or one instance per user

**URL:** <https://discuss.elastic.co/t/elasticsearch-java-rest-client-singleton-or-one-instance-per-user/101176>\
**Category:** Elasticsearch\
**Created:** [September 20, 2017, 1:50pm UTC](https://discuss.elastic.co/t/elasticsearch-java-rest-client-singleton-or-one-instance-per-user/101176 "2017-09-20T13:50:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajesh\_Kumar](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@Rajesh\_Kumar](https://discuss.elastic.co/u/Rajesh_Kumar)\
**Post date:** [September 20, 2017, 1:50pm UTC](https://discuss.elastic.co/t/elasticsearch-java-rest-client-singleton-or-one-instance-per-user/101176/1 "2017-09-20T13:50:26Z")

</div>

Hi,  
I am planning to use Java REST client in our application. Ours is a Java RESTful application running on Tomcat. We will have lot of search requests to ElasticSearch per second from different users. What is the best practice - To create a Singleton and use it application wide or create one instance per user?

If Singleton is the way to go, how many concurrent requests it can serve? Will that approach be scalable?

Thanks and Regards,  
Rajesh

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 18, 2017, 1:50pm UTC](https://discuss.elastic.co/t/elasticsearch-java-rest-client-singleton-or-one-instance-per-user/101176/2 "2017-10-18T13:50:26Z")

</div>

Closed on October 18, 2017, 1:50pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
