# Correct way to have different databases connected to different elasticsearches

**URL:** <https://discuss.elastic.co/t/correct-way-to-have-different-databases-connected-to-different-elasticsearches/352856>\
**Category:** Elasticsearch\
**Created:** [February 8, 2024, 12:07pm UTC](https://discuss.elastic.co/t/correct-way-to-have-different-databases-connected-to-different-elasticsearches/352856 "2024-02-08T12:07:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike\_mike](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_mike/32/131574_2.png) [@mike\_mike](https://discuss.elastic.co/u/mike_mike)\
**Post date:** [February 8, 2024, 12:07pm UTC](https://discuss.elastic.co/t/correct-way-to-have-different-databases-connected-to-different-elasticsearches/352856/1 "2024-02-08T12:07:28Z")

</div>

Hello all,  
I am new here and kinda new to the way Elasticsearch **should** work (cause I am already working with it, but I miss lots of documentation principles).

We mainly use ES as a faster way to retrieve important data (instead of querying the DB).

The case I need help with is the following:  
I have 2 different DBs, each referring to a different project.  
What is the optimal way to have 1 ES for each of those DBs?  
I tried creating 2 different ES services (although I read it is not recommended) and still failed 🙂  
Then I read I can configure 2 different nodes each with each own indexes and also look at different ports. How can I do that?  
Is this the optimal way to achieve the result I need? Or there is a better way to have multiple DBs connected to different ES?

Thank you

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2024, 3:17pm UTC](https://discuss.elastic.co/t/correct-way-to-have-different-databases-connected-to-different-elasticsearches/352856/2 "2024-02-08T15:17:29Z")

</div>

Welcome!

What about one index per use case? But one single Elasticsearch cluster...

---

<div class="post-metadata">

**Author:** ![mike\_mike](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mike_mike/32/131574_2.png) [@mike\_mike](https://discuss.elastic.co/u/mike_mike)\
**Post date:** [February 9, 2024, 9:57am UTC](https://discuss.elastic.co/t/correct-way-to-have-different-databases-connected-to-different-elasticsearches/352856/3 "2024-02-09T09:57:12Z")

</div>

Thank you, I will

---

<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:** [March 8, 2024, 9:57am UTC](https://discuss.elastic.co/t/correct-way-to-have-different-databases-connected-to-different-elasticsearches/352856/4 "2024-03-08T09:57:42Z")

</div>

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