# Multi Data Center Deployment

**URL:** <https://discuss.elastic.co/t/multi-data-center-deployment/3331>\
**Category:** Elasticsearch\
**Created:** [September 13, 2010, 7:21pm UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331 "2010-09-13T19:21:46Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![talsalmona](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/talsalmona/32/3316_2.png) [@talsalmona](https://discuss.elastic.co/u/talsalmona)\
**Post date:** [September 13, 2010, 7:21pm UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331/1 "2010-09-13T19:21:46Z")

</div>

Hi community,

I've recently started looking into deploying ElasticSearch in two data  
centers.  
My initial though is to build an ES cluster on each of the data  
centers and in addition to have couchdb instances on each of the data  
centers.  
When indexing, I will push the JSON into couch and ES and will let  
couch do its sync magic between the data centers and then index the  
JSON again on the other end.  
I can suffer some delays in sync between the data centers.

The one thing I don't really like about this solution is that I need  
to build a layer ontop of ES and couch and that I need to duplicate  
data.

Any thoughts?

Thanks,  
Tal

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 13, 2010, 10:31pm UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331/2 "2010-09-13T22:31:42Z")

</div>

Hi,

Sounds like a good solution. That layer on top of couchdb is something  
that I am working on as a "side" project. Its part of a larger effort I call  
"indexer". I will post something on it once I have more concrete things to  
show.

Multi data center is always an interesting problem for distributed  
systems, and its not easy to solve it, and any solution comes with its  
drawbacks. Even so called nosql solutions that can span multiple data  
centers easily sacrifice things to achieve that (and no, I am not talking  
about consistency here, which is eventual in those solutions, but on the  
fact that you can actually loose data).

I do plan to attack this problem in elasticsearch. For now, the best  
solution is doing something similar to what you suggest (couchdb) or using a  
messaging later between the two clusters.

-shay.banon

On Mon, Sep 13, 2010 at 9:21 PM, Tal [talsalmona@gmail.com](mailto:talsalmona@gmail.com) wrote:

> Hi community,
> 
> I've recently started looking into deploying Elasticsearch in two data  
> centers.  
> My initial though is to build an ES cluster on each of the data  
> centers and in addition to have couchdb instances on each of the data  
> centers.  
> When indexing, I will push the JSON into couch and ES and will let  
> couch do its sync magic between the data centers and then index the  
> JSON again on the other end.  
> I can suffer some delays in sync between the data centers.
> 
> The one thing I don't really like about this solution is that I need  
> to build a layer ontop of ES and couch and that I need to duplicate  
> data.
> 
> Any thoughts?
> 
> Thanks,  
> Tal

---

<div class="post-metadata">

**Author:** ![Mahendra\_M](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mahendra_m/32/3128_2.png) [@Mahendra\_M](https://discuss.elastic.co/u/Mahendra_M)\
**Post date:** [September 14, 2010, 5:17am UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331/3 "2010-09-14T05:17:08Z")

</div>

Hi Shay,

On Tue, Sep 14, 2010 at 4:01 AM, Shay Banon wrote:

> Sounds like a good solution. That layer on top of couchdb is something  
> that I am working on as a "side" project. Its part of a larger effort I call  
> "indexer". I will post something on it once I have more concrete things to  
> show.

I was also working on something similar. A listener on couchdb  
\_changes, which keeps syncing with Elasticsearch. Was working on an  
"async" version using twisted also.

Let me know if I can help out in your project. Maybe, I can stop  
working on my stuff and focus on yours instead...

Regards,  
Mahendra

[http://twitter.com/mahendra](http://twitter.com/mahendra)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 14, 2010, 1:31pm UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331/4 "2010-09-14T13:31:28Z")

</div>

I am currently building the infra within elasticsearch to support indexers  
(of any type) with hot failover and async state storage. Once its done, then  
one such indexer can be couchdb (running from "within" elasticsearch).

-shay.banon

On Tue, Sep 14, 2010 at 7:17 AM, Mahendra M [mahendra.m@gmail.com](mailto:mahendra.m@gmail.com) wrote:

> Hi Shay,
> 
> On Tue, Sep 14, 2010 at 4:01 AM, Shay Banon wrote:
> 
> > Sounds like a good solution. That layer on top of couchdb is something  
> > that I am working on as a "side" project. Its part of a larger effort I  
> > call  
> > "indexer". I will post something on it once I have more concrete things  
> > to  
> > show.
> 
> I was also working on something similar. A listener on couchdb  
> \_changes, which keeps syncing with Elasticsearch. Was working on an  
> "async" version using twisted also.
> 
> Let me know if I can help out in your project. Maybe, I can stop  
> working on my stuff and focus on yours instead...
> 
> Regards,  
> Mahendra
> 
> [http://twitter.com/mahendra](http://twitter.com/mahendra)

---

<div class="post-metadata">

**Author:** ![Benoit\_Chesneau](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benoit_chesneau/32/2822_2.png) [@Benoit\_Chesneau](https://discuss.elastic.co/u/Benoit_Chesneau)\
**Post date:** [September 15, 2010, 12:53pm UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331/5 "2010-09-15T12:53:43Z")

</div>

On Sep 14, 3:31 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> I am currently building the infra within elasticsearch to support indexers  
> (of any type) with hot failover and async state storage. Once its done, then  
> one such indexer can be couchdb (running from "within" elasticsearch).
> 
> -shay.banon
> 
> On Tue, Sep 14, 2010 at 7:17 AM, Mahendra M [mahendr...@gmail.com](mailto:mahendr...@gmail.com) wrote:
> 
> > Hi Shay,
> 
> > On Tue, Sep 14, 2010 at 4:01 AM, Shay Banon wrote:
> > 
> > > Sounds like a good solution. That layer on top of couchdb is something  
> > > that I am working on as a "side" project. Its part of a larger effort I  
> > > call  
> > > "indexer". I will post something on it once I have more concrete things  
> > > to  
> > > show.
> 
> > I was also working on something similar. A listener on couchdb  
> > \_changes, which keeps syncing with Elasticsearch. Was working on an  
> > "async" version using twisted also.
> 
> > Let me know if I can help out in your project. Maybe, I can stop  
> > working on my stuff and focus on yours instead...
> 
> > Regards,  
> > Mahendra
> 
> > [http://twitter.com/mahendra](http://twitter.com/mahendra)

Can you say more about it ? I'm working on such stuff too.

- benoit

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 15, 2010, 5:44pm UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331/6 "2010-09-15T17:44:10Z")

</div>

Its hard to say much, since things are forming as I speak. In general the  
idea is that there will be indexers (similar in concept to indices as  
entities in the cluster, but do not hold data or shared). Those indexers are  
allocate to nodes and run and their job is the index new data into  
elasticsearch. elasticsearch will provide failover support for those  
indexers (i.e. a node failed, they will be started on another node), and  
simple state storage (index document 1000, if get restarted, need to start  
reindexing from there).

An indexer will be open, with different types of indexer implementation. One  
of them can be something the reads streams of couchdb changes and indexes  
them. Others can listen to a rabbitmq queue and index data. Really, the sky  
is the limit with the different indexers that can be implemented. I hope  
also to get it open to be written easily in other languages as well (like  
(j)rub, groovy, ...).

-shay.banon

On Wed, Sep 15, 2010 at 2:53 PM, Benoit Chesneau [bchesneau@gmail.com](mailto:bchesneau@gmail.com)wrote:

> On Sep 14, 3:31 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > I am currently building the infra within elasticsearch to support  
> > indexers  
> > (of any type) with hot failover and async state storage. Once its done,  
> > then  
> > one such indexer can be couchdb (running from "within" elasticsearch).
> > 
> > -shay.banon
> > 
> > On Tue, Sep 14, 2010 at 7:17 AM, Mahendra M [mahendr...@gmail.com](mailto:mahendr...@gmail.com)  
> > wrote:
> > 
> > > Hi Shay,
> > 
> > > On Tue, Sep 14, 2010 at 4:01 AM, Shay Banon wrote:
> > > 
> > > > Sounds like a good solution. That layer on top of couchdb is  
> > > > something  
> > > > that I am working on as a "side" project. Its part of a larger effort  
> > > > I  
> > > > call  
> > > > "indexer". I will post something on it once I have more concrete  
> > > > things  
> > > > to  
> > > > show.
> > 
> > > I was also working on something similar. A listener on couchdb  
> > > \_changes, which keeps syncing with Elasticsearch. Was working on an  
> > > "async" version using twisted also.
> > 
> > > Let me know if I can help out in your project. Maybe, I can stop  
> > > working on my stuff and focus on yours instead...
> > 
> > > Regards,  
> > > Mahendra
> > 
> > > [http://twitter.com/mahendra](http://twitter.com/mahendra)
> 
> Can you say more about it ? I'm working on such stuff too.
> 
> - benoit

---

<div class="post-metadata">

**Author:** ![Benoit\_Chesneau](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benoit_chesneau/32/2822_2.png) [@Benoit\_Chesneau](https://discuss.elastic.co/u/Benoit_Chesneau)\
**Post date:** [September 20, 2010, 5:47am UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331/7 "2010-09-20T05:47:49Z")

</div>

On Sep 15, 7:44 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Its hard to say much, since things are forming as I speak. In general the  
> idea is that there will be indexers (similar in concept to indices as  
> entities in the cluster, but do not hold data or shared). Those indexers are  
> allocate to nodes and run and their job is the index new data into  
> elasticsearch. elasticsearch will provide failover support for those  
> indexers (i.e. a node failed, they will be started on another node), and  
> simple state storage (index document 1000, if get restarted, need to start  
> reindexing from there).
> 
> An indexer will be open, with different types of indexer implementation. One  
> of them can be something the reads streams of couchdb changes and indexes  
> them. Others can listen to a rabbitmq queue and index data. Really, the sky  
> is the limit with the different indexers that can be implemented. I hope  
> also to get it open to be written easily in other languages as well (like  
> (j)rub, groovy, ...).
> 
> -shay.banon

My idea is simpler here.

I want to plug the indexer in CouchDB directly here, so using the  
CouchDB internal system to detect when a doc need to be indexed or  
reindexed in the same day we do for views. Using BigCouch this indexer  
will be run on each CouchDB nodes then put in elasitc search rather  
than saving to the fs. A custom handler will allow to query  
elasticsearch or anything other. Basically CouchDB is the provider and  
api point.

- benoit

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 20, 2010, 8:59am UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331/8 "2010-09-20T08:59:40Z")

</div>

Sounds good. Thats another option for an integration point which can be  
better (especially for systems that don't provide "changes" API). PIng us if  
you make it open source, I will post it on the elasticsearch website.

-shay.banon

On Mon, Sep 20, 2010 at 7:47 AM, Benoit Chesneau [bchesneau@gmail.com](mailto:bchesneau@gmail.com)wrote:

> On Sep 15, 7:44 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Its hard to say much, since things are forming as I speak. In general the  
> > idea is that there will be indexers (similar in concept to indices as  
> > entities in the cluster, but do not hold data or shared). Those indexers  
> > are  
> > allocate to nodes and run and their job is the index new data into  
> > elasticsearch. elasticsearch will provide failover support for those  
> > indexers (i.e. a node failed, they will be started on another node), and  
> > simple state storage (index document 1000, if get restarted, need to  
> > start  
> > reindexing from there).
> > 
> > An indexer will be open, with different types of indexer implementation.  
> > One  
> > of them can be something the reads streams of couchdb changes and indexes  
> > them. Others can listen to a rabbitmq queue and index data. Really, the  
> > sky  
> > is the limit with the different indexers that can be implemented. I hope  
> > also to get it open to be written easily in other languages as well (like  
> > (j)rub, groovy, ...).
> > 
> > -shay.banon
> 
> My idea is simpler here.
> 
> I want to plug the indexer in CouchDB directly here, so using the  
> CouchDB internal system to detect when a doc need to be indexed or  
> reindexed in the same day we do for views. Using BigCouch this indexer  
> will be run on each CouchDB nodes then put in elasitc search rather  
> than saving to the fs. A custom handler will allow to query  
> elasticsearch or anything other. Basically CouchDB is the provider and  
> api point.
> 
> - benoit

---

<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:** [July 6, 2017, 4:19am UTC](https://discuss.elastic.co/t/multi-data-center-deployment/3331/9 "2017-07-06T04:19:12Z")

</div>


