# Using Nest in AWS Lambda

**URL:** <https://discuss.elastic.co/t/using-nest-in-aws-lambda/283340>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 4, 2021, 9:52am UTC](https://discuss.elastic.co/t/using-nest-in-aws-lambda/283340 "2021-09-04T09:52:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![imranazad](https://avatars.discourse-cdn.com/v4/letter/i/c2a13f/32.png) [@imranazad](https://discuss.elastic.co/u/imranazad)\
**Post date:** [September 4, 2021, 9:52am UTC](https://discuss.elastic.co/t/using-nest-in-aws-lambda/283340/1 "2021-09-04T09:52:22Z")

</div>

Has anyone used Nest with AWS Lambda? How did you deal with cold starts? The size of dlls affects performance and Nests library is large, the version we're using is 4 megabytes. Is there a light weight version of the NEST library just for querying?

---

<div class="post-metadata">

**Author:** ![stevejgordon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevejgordon/32/80912_2.png) [@stevejgordon](https://discuss.elastic.co/u/stevejgordon)\
**Post date:** [September 6, 2021, 6:59am UTC](https://discuss.elastic.co/t/using-nest-in-aws-lambda/283340/2 "2021-09-06T06:59:38Z")

</div>

Hi,

We recently [published some general advice](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/function-as-a-service-environments.html) for using the library within FaaS platforms which may be helpful. There will still be a cold start cost to initialise the client, but all FaaS platforms other ways to store global state which removes this cost across executions.

NEST itself has a lot of types to handle all of the possible requests and responses from Elasticsearch. You could drop to the [low-level client](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/elasticsearch-net-getting-started.html) which does not ship these types and is therefore smaller. However, you will need to handle types to represent the requests and responses.

Cheers,  
Steve

---

<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 4, 2021, 7:00am UTC](https://discuss.elastic.co/t/using-nest-in-aws-lambda/283340/3 "2021-10-04T07:00:36Z")

</div>

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