# How to use elasticsearch-js and serverless together

**URL:** <https://discuss.elastic.co/t/how-to-use-elasticsearch-js-and-serverless-together/222160>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [March 4, 2020, 9:06pm UTC](https://discuss.elastic.co/t/how-to-use-elasticsearch-js-and-serverless-together/222160 "2020-03-04T21:06:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlegault](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mlegault](https://discuss.elastic.co/u/mlegault)\
**Post date:** [March 4, 2020, 9:06pm UTC](https://discuss.elastic.co/t/how-to-use-elasticsearch-js-and-serverless-together/222160/1 "2020-03-04T21:06:51Z")

</div>

Hi !

I'm currently trying to use the sdk elasticsearch-js in a serverless environment (aws) and I was wondering if it was a good idea to initialize a new client everytime a lambda is called. Our application is also multi-tenant so we unfortunately can't reuse the client easily with the execution context for security.

For example, would the Elasticsearch instance work if we have 100+ concurrent clients (talking about the javascript object Client).

Thanks in advance and have a good day !

---

<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:** [April 1, 2020, 9:07pm UTC](https://discuss.elastic.co/t/how-to-use-elasticsearch-js-and-serverless-together/222160/2 "2020-04-01T21:07:13Z")

</div>

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