# Usage pattern for ElasticsearchClient for multiple regions .NET

**URL:** <https://discuss.elastic.co/t/usage-pattern-for-elasticsearchclient-for-multiple-regions-net/334721>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [May 30, 2023, 8:07pm UTC](https://discuss.elastic.co/t/usage-pattern-for-elasticsearchclient-for-multiple-regions-net/334721 "2023-05-30T20:07:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthew\_gen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_gen/32/117115_2.png) [@matthew\_gen](https://discuss.elastic.co/u/matthew_gen)\
**Post date:** [May 30, 2023, 8:07pm UTC](https://discuss.elastic.co/t/usage-pattern-for-elasticsearchclient-for-multiple-regions-net/334721/1 "2023-05-30T20:07:04Z")

</div>

I have two different elastic deployments that are in two different regions. Both clusters exist under the same elastic org account.

Is the recommended usage pattern to create a singleton instance for **each** deployment? Or should I have one client and change the value of the api key and cloud id properties when I need to write to a corresponding deployment? I am reading on the best usage patterns and it is not clear to me if I should try to reuse the same Elasticsearch client or make one for each deployment.

> **[Usage recommendations | Elasticsearch .NET Client \[8.1\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/recommendations.html)**

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 30, 2023, 11:47pm UTC](https://discuss.elastic.co/t/usage-pattern-for-elasticsearchclient-for-multiple-regions-net/334721/2 "2023-05-30T23:47:23Z")

</div>

If they are separate clusters then yes, you will need separate client instances.

---

<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:** [June 27, 2023, 11:48pm UTC](https://discuss.elastic.co/t/usage-pattern-for-elasticsearchclient-for-multiple-regions-net/334721/3 "2023-06-27T23:48:07Z")

</div>

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